summaryrefslogtreecommitdiff
path: root/internal_rewrite/update_clientside_animation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'internal_rewrite/update_clientside_animation.cpp')
-rw-r--r--internal_rewrite/update_clientside_animation.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/internal_rewrite/update_clientside_animation.cpp b/internal_rewrite/update_clientside_animation.cpp
index 46f92fa..cf1db8b 100644
--- a/internal_rewrite/update_clientside_animation.cpp
+++ b/internal_rewrite/update_clientside_animation.cpp
@@ -88,7 +88,7 @@ void __fastcall hooks::update_clientside_animation( void* ecx_, void* edx_ ) {
float lerp_progress = ( last_update + lerp - g_csgo.m_globals->m_curtime ) / lerp;
float lerp_yaw = 0.f;
- if( !first_update && ( ent->get_animstate( )->m_velocity > 0.1f || std::abs( last_yaw - ent->get_animstate( )->m_flGoalFeetYaw ) < 35.f ) ) {
+ if( !first_update && ( ent->get_animstate( )->m_velocity > 0.1f || std::abs( last_yaw - ent->get_animstate( )->m_flGoalFeetYaw ) < 35.f ) && update_delta <= TICK_INTERVAL( ) * 2.f ) {
float yaw = ent->get_animstate( )->m_flGoalFeetYaw;
if( yaw < 0.f )
yaw += 360.f;
@@ -96,8 +96,7 @@ void __fastcall hooks::update_clientside_animation( void* ecx_, void* edx_ ) {
if( std::abs( yaw - last_yaw ) >= 180.f )
lerp_yaw = yaw;
else {
- float jmp_yaw = math::lerp( prev_anims.m_last_simtime, yaw, update_lerp / update_delta );
- lerp_yaw = math::lerp( yaw, jmp_yaw, std::clamp( lerp_progress, 0.f, 1.f ) );
+ lerp_yaw = math::lerp( yaw, last_yaw, std::clamp( lerp_progress, 0.f, 1.f ) );
}
}
else {
@@ -116,8 +115,7 @@ void __fastcall hooks::update_clientside_animation( void* ecx_, void* edx_ ) {
if( !isfinite( old_param ) || !isfinite( param ) )
continue;
- float jmp_param = math::lerp( old_param, param, update_lerp / update_delta );
- float final_param = math::lerp( param, jmp_param, std::clamp( lerp_progress, 0.f, 1.f ) );
+ float final_param = math::lerp( param, old_param, std::clamp( lerp_progress, 0.f, 1.f ) );
ent->m_flPoseParameter( )[ i ] = final_param;
}
@@ -130,8 +128,7 @@ void __fastcall hooks::update_clientside_animation( void* ecx_, void* edx_ ) {
cycle += 1.f;
}
- float jmp_cycle = math::lerp( old_cycle, cycle, update_lerp / update_delta );
- float final_cycle = math::lerp( cycle, jmp_cycle, std::clamp( lerp_progress, 0.f, 1.f ) );
+ float final_cycle = math::lerp( cycle, old_cycle, std::clamp( lerp_progress, 0.f, 1.f ) );
if( final_cycle > 1.f )
final_cycle -= 1.f;