diff options
| author | boris <wzn@moneybot.cc> | 2018-11-28 16:00:02 +1300 |
|---|---|---|
| committer | boris <wzn@moneybot.cc> | 2018-11-28 16:00:02 +1300 |
| commit | 3d412a4b30a9f7c7f51ea6562e694315948bd3da (patch) | |
| tree | 26d67dfd1f3e5fd12903ad13e85d0cb8bcf8f21c /cheat/internal_rewrite/update_clientside_animation.cpp | |
| parent | e4729e4393d90271a3814c7a79950a660c48325a (diff) | |
cleaned up
in short, the cheat and loader are now separate solutions. unused stuff was moved into the legacy solution in case anyone wants to compile it or whatever.
i can change this back if you want to. also, i configured the loader to compile in x64, and have separate build types for linux and win64
Diffstat (limited to 'cheat/internal_rewrite/update_clientside_animation.cpp')
| -rw-r--r-- | cheat/internal_rewrite/update_clientside_animation.cpp | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/cheat/internal_rewrite/update_clientside_animation.cpp b/cheat/internal_rewrite/update_clientside_animation.cpp new file mode 100644 index 0000000..201d100 --- /dev/null +++ b/cheat/internal_rewrite/update_clientside_animation.cpp @@ -0,0 +1,48 @@ +#include "hooks.hpp"
+#include "context.hpp"
+#include "base_cheat.hpp"
+
+void __fastcall hooks::update_clientside_animation( void* ecx_, void* edx_ ) {
+ static bool first_update = true;
+
+ auto old_func = update_clientside_animation_o;
+
+ if( ecx_ != g_ctx.m_local )
+ return old_func( ecx_, 0 );
+
+ auto ent = ( c_base_player* )( ecx_ );
+
+ static float last_update;
+ static float last_spawntime = 0.f;
+
+ // Arbitrary number much.
+ if( !g_settings.rage.anti_aim || !g_ctx.m_local->is_valid( ) || std::abs( last_update - g_csgo.m_globals->m_curtime ) > TICKS_TO_TIME( 20 ) || last_spawntime != ent->m_flSpawnTime( ) ) {
+ last_update = g_csgo.m_globals->m_curtime;
+ first_update = true;
+
+ if( last_spawntime != ent->m_flSpawnTime( ) )
+ last_spawntime = ent->m_flSpawnTime( );
+
+ return old_func( ecx_, edx_ );
+ }
+
+ last_update = g_csgo.m_globals->m_curtime;
+
+ ent->get_animstate( )->m_iLastClientSideAnimationUpdateFramecount = g_csgo.m_globals->m_framecount;
+ old_func( ecx_, edx_ );
+
+ if( !first_update ) {
+ g_ctx.m_local->restore_anim_data( true );
+
+ ent->set_abs_angles( vec3_t( 0, g_ctx.m_absyaw, 0 ) );
+ bool backup = ent->get_animstate( )->m_bOnGround;
+ ent->get_animstate( )->m_bOnGround = false;
+
+ ent->invalidate_bone_cache( );
+ ent->ce( )->SetupBones( nullptr, 128, BONE_USED_BY_ANYTHING, 0.f );
+
+ ent->get_animstate( )->m_bOnGround = backup;
+ }
+
+ first_update = false;
+}
\ No newline at end of file |
