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.cpp55
1 files changed, 11 insertions, 44 deletions
diff --git a/internal_rewrite/update_clientside_animation.cpp b/internal_rewrite/update_clientside_animation.cpp
index d61916a..e7889c1 100644
--- a/internal_rewrite/update_clientside_animation.cpp
+++ b/internal_rewrite/update_clientside_animation.cpp
@@ -8,7 +8,7 @@ void __fastcall hooks::update_clientside_animation( void* ecx_, void* edx_ ) {
auto old_func = update_clientside_animation_o;
if( ecx_ != g_ctx.m_local )
- return old_func( ecx_, edx_ );
+ return old_func( ecx_, 0 );
auto ent = ( c_base_player* )( ecx_ );
@@ -27,53 +27,20 @@ void __fastcall hooks::update_clientside_animation( void* ecx_, void* edx_ ) {
return old_func( ecx_, edx_ );
}
- *( byte* )( uintptr_t( ent ) + 0x270 ) = 1;
- if( !g_cheat.m_lagmgr.get_choked( ) || g_cheat.m_lagmgr.get_sent( ) > 1 || first_update ) {
- vec3_t backup;
- g_csgo.m_prediction( )->GetLocalViewAngles( backup );
-
-
- float backup_curtime = g_csgo.m_globals->m_curtime;
- float backup_frametime = g_csgo.m_globals->m_frametime;
-
- last_update = backup_curtime;
-
- g_csgo.m_globals->m_curtime = g_ctx.pred_time( );
- g_csgo.m_globals->m_frametime = TICK_INTERVAL( );
-
- if( g_csgo.m_globals->m_curtime != ent->get_animstate( )->m_flLastClientSideAnimationUpdateTime ) {
- last_update = backup_curtime;
-
- vec3_t real_angle = g_ctx.m_thirdperson_angle;
+ last_update = g_csgo.m_globals->m_curtime;
- float pitch;
- if( g_ctx.m_local->get_animstate( )->m_bInHitGroundAnimation && ( g_ctx.m_local->m_fFlags( ) & FL_ONGROUND ) ) {
- bool dist = g_settings.rage.enabled( ) && g_settings.rage.selection_type( ) == 1;
- int target = util::get_closest_player( dist );
+ float backup_curtime = g_csgo.m_globals->m_curtime;
+ float backup_frametime = g_csgo.m_globals->m_frametime;
- if( target != -1 ) {
- auto t = g_csgo.m_entlist( )->GetClientEntity( target );
+ g_csgo.m_globals->m_curtime = g_ctx.pred_time( );
+ g_csgo.m_globals->m_frametime = TICK_INTERVAL( );
- pitch = math::vector_angles( ent->m_vecOrigin( ), t->m_vecOrigin( ) ).x;
- }
- else
- pitch = -10.f;
-
- real_angle.x = pitch;
- }
-
- ent->get_animstate( )->update( real_angle.y, real_angle.x );
- old_func( ecx_, edx_ );
-
- ent->cache_anim_data( );
- }
-
- g_csgo.m_prediction( )->SetLocalViewAngles( backup );
- g_csgo.m_globals->m_curtime = backup_curtime;
- g_csgo.m_globals->m_frametime = backup_frametime;
- }
+ ent->get_animstate( )->m_iLastClientSideAnimationUpdateFramecount = g_csgo.m_globals->m_framecount;
+ //ent->get_animstate( )->m_flLastClientSideAnimationUpdateTime = g_csgo.m_globals->m_curtime;
+ old_func( ecx_, edx_ );
- ent->restore_anim_data( true );
+ g_csgo.m_globals->m_curtime = backup_curtime;
+ g_csgo.m_globals->m_frametime = backup_frametime;
if( !first_update ) {
//*( byte* )( uintptr_t( ent ) + 0x270 ) = 0;