From 3e0d8199fec5b6979dc280533de69dded4260a0f Mon Sep 17 00:00:00 2001 From: navewindre Date: Sat, 6 Oct 2018 12:09:36 +0200 Subject: z\cxdtgs --- internal_rewrite/begin_lock.cpp | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'internal_rewrite/begin_lock.cpp') diff --git a/internal_rewrite/begin_lock.cpp b/internal_rewrite/begin_lock.cpp index b7e310e..ec4494b 100644 --- a/internal_rewrite/begin_lock.cpp +++ b/internal_rewrite/begin_lock.cpp @@ -16,14 +16,22 @@ void __fastcall hooks::begin_lock( void* ecx, void* edx ) { // THIS IS PROLLY NO g_cheat.m_visuals.world_modulate( ); if( g_settings.rage.anti_aim && g_ctx.run_frame( ) ) { - auto& anims = g_ctx.m_local->get_animdata( ).m_animlayers; - - for( size_t i{ }; i < 13; ++i ) { - auto& layer = g_ctx.m_local->m_AnimOverlay( ).GetElements( )[ i ]; - - if( layer.m_flWeight != anims.at( i ).m_flWeight || layer.m_flCycle != anims.at( i ).m_flCycle ) { - g_ctx.m_local->cache_anim_data( ); - break; + static float last_time = 0.f; + + if( last_time != g_ctx.m_local->get_animstate( )->m_flLastClientSideAnimationUpdateTime ) { + auto& anims = g_ctx.m_local->get_animdata( ).m_animlayers; + + for( size_t i{ }; i < 13; ++i ) { + auto& layer = g_ctx.m_local->m_AnimOverlay( ).GetElements( )[ i ]; + + if( layer.m_flWeight != anims.at( i ).m_flWeight || layer.m_flCycle != anims.at( i ).m_flCycle ) { + memcpy( &g_ctx.m_local->get_animdata( ).m_animlayers, + g_ctx.m_local->m_AnimOverlay( ).GetElements( ), + sizeof( C_AnimationLayer ) * 13 ); + + last_time = g_ctx.m_local->get_animstate( )->m_flLastClientSideAnimationUpdateTime; + break; + } } } } -- cgit v1.2.3