// This is an independent project of an individual developer. Dear PVS-Studio, please check it.
// PVS-Studio Static Code Analyzer for C, C++, C#, and Java: http://www.viva64.com
#include "animation_system.h"
#include "..\ragebot\aim.h"
#include "..\autowall\autowall.h"
#include "..\cheats\shit.hpp"
void resolver::initialize(player_t* e, adjust_data* record, const float& pitch)
{
player = e;
player_record = record;
original_pitch = math::normalize_pitch(pitch);
}
void resolver::reset()
{
player = nullptr;
player_record = nullptr;
original_pitch = 0.0f;
}
void resolver::ResolveAngles()
{
player_info_t player_info;
adjust_data* record;
resolver* resolver_adjust;
if (!m_engine()->GetPlayerInfo(player->EntIndex(), &player_info))
return;
int missed = g_ctx.globals.missed_shots[player->EntIndex()];
if (player_info.fakeplayer || !g_ctx.local()->is_alive() || player->m_iTeamNum() == g_ctx.local()->m_iTeamNum())
{
missed = 0;
return;
}
const auto animstate = player->get_animation_state();
if (!animstate)
return;
// if store delta when server anim layer = resolver anim layer.
//store_deltas(player);
/*
@note - der grobe.
acculate pose a try resolve players.
*/
auto v56 = math::angle_difference(player->m_angEyeAngles().y, animstate->m_flGoalFeetYaw) > 0.f ? -1 : 1;
float move_delta = 0.f;
float speed = player->m_vecVelocity().Length2D();
int act = player->sequence_activity(player_record->layers[3].m_nSequence);
bool moving = (player_record->layers[12].m_flWeight * 1000.f) && (player_record->layers[6].m_flWeight * 1000.f) == (player_record->layers[6].m_flWeight * 1000.f);
auto delta = math::angle_difference(player->m_angEyeAngles().y, player->m_flLowerBodyYawTarget());
if (player->m_fFlags() & FL_ONGROUND)
{
if (speed <= 1.1f)
{
if (speed > 1.0f && !moving)
{
if (resolver_adjust->server_anim_layer[3].m_flWeight == 0.0f && resolver_adjust->server_anim_layer[3].m_flCycle == 0.0f)
{
const auto v53 = fabsf(resolver_adjust->server_anim_layer[6].m_flPlaybackRate - resolver_adjust->resolver_anim_layer[0][6].m_flPlaybackRate);
const auto v54 = fabsf(resolver_adjust->server_anim_layer[6].m_flPlaybackRate - resolver_adjust->resolver_anim_layer[2][6].m_flPlaybackRate);
const auto v55 = fabsf(resolver_adjust->server_anim_layer[6].m_flPlaybackRate - resolver_adjust->resolver_anim_layer[1][6].m_flPlaybackRate);
if (v53 < v54 || v55 <= v55 || float(!v55 * 1000.0))
{
if (v54 > v55 || v53 >= v54 || float(v54 * 1000.0))
{
if ((v54 * 10000.f) != (v55 * 1000.0))
{
if (v53 <= v54)
move_delta = v53;
else
move_delta = v53;
if (move_delta > v55)
move_delta = v54;
/*
@note - der grobe.
create animation layer a two matrixes and create !server goal feet yaw.
*/
if (!(move_delta * 1000.f) && (v55 * 1000.f) != (v54 * 1000.f))
{
if (move_delta == v55)
{
//v56 = -v56;
v54 = v55;
}
else if (move_delta == v54)
{
v55 = v54;
LABEL_51:
auto delta_lby = math::angle_difference(animstate->m_flEyeYaw, player->m_flLowerBodyYawTarget());
if (abs(delta_lby) > 35.f)
/* delta_lby =*/ -delta_lby;
goto LABEL_51;
}
}
}
}
}
}
}
}
/*
@note - der grobe.
break adjust balance for try resolve player using desync balance or break lby.
*/
else if (speed <= 0.1f)
{
if (resolver_adjust->server_anim_layer[3].m_flWeight == 1.0f && resolver_adjust->server_anim_layer[3].m_flWeightDeltaRate == 0.0f)
{
if (act == 979)
{
auto delta_lby = math::angle_difference(animstate->m_flEyeYaw, player->m_flLowerBodyYawTarget());
if (abs(delta_lby) > 35.f)
/*delta_lby =*/ -delta_lby;
}
/*else
{
v56 == -delta;
}*/
}
}
}
}
float resolver::resolve_pitch()
{
return original_pitch;
}