void Resolver::AnimationFix(C_BaseEntity* pEnt)
{
if (pEnt == g::LocalPlayer) {
pEnt->ClientAnimations(true);
auto player_animation_state = pEnt->AnimState();
player_animation_state->m_flLeanAmount = 20;
player_animation_state->m_flCurrentTorsoYaw += 15;
pEnt->UpdateClientAnimation();
pEnt->SetAbsAngles(Vector(0, player_animation_state->m_flGoalFeetYaw, 0));
pEnt->ClientAnimations(false);
}
else {
auto player_index = pEnt->EntIndex() - 1;
pEnt->ClientAnimations(true);
auto old_curtime = g_pGlobalVars->curtime;
auto old_frametime = g_pGlobalVars->frametime;
g_pGlobalVars->curtime = pEnt->GetSimulationTime();
g_pGlobalVars->frametime = g_pGlobalVars->intervalPerTick;
auto player_animation_state = pEnt->AnimState();
auto player_model_time = reinterpret_cast<int*>(player_animation_state + 112);
if (player_animation_state != nullptr && player_model_time != nullptr)
if (*player_model_time == g_pGlobalVars->framecount)
*player_model_time = g_pGlobalVars->framecount - 1;
pEnt->UpdateClientAnimation();
g_pGlobalVars->curtime = old_curtime;
g_pGlobalVars->frametime = old_frametime;
//pEnt->SetAbsAngles(Vector(0, player_animation_state->m_flGoalFeetYaw, 0));
pEnt->ClientAnimations(false);
}
}