summaryrefslogtreecommitdiff
path: root/internal_rewrite/c_base_player.cpp
diff options
context:
space:
mode:
authornavewindre <boneyaard@gmail.com>2018-09-01 14:23:02 +0200
committernavewindre <boneyaard@gmail.com>2018-09-01 14:23:02 +0200
commitbeb5515757c0e653adc33f181184fe3791ca0a6b (patch)
tree68f123f602795a31a8811bd56e3b3271c102a3fa /internal_rewrite/c_base_player.cpp
parent0767d6d4acaf5f86a67a375dffa54da9323646e3 (diff)
dasdadasf
Diffstat (limited to 'internal_rewrite/c_base_player.cpp')
-rw-r--r--internal_rewrite/c_base_player.cpp26
1 files changed, 23 insertions, 3 deletions
diff --git a/internal_rewrite/c_base_player.cpp b/internal_rewrite/c_base_player.cpp
index 5274f63..ad2ec2d 100644
--- a/internal_rewrite/c_base_player.cpp
+++ b/internal_rewrite/c_base_player.cpp
@@ -31,14 +31,22 @@ void IKContext::SolveDependencies( vec3_t* pos, void* q, matrix3x4* bone_array,
}
bool& c_base_player::s_bInvalidateBoneCache( ) {
+#ifdef HEADER_MODULE
+ static auto fn_ptr = g_header.patterns.animstate_update;
+#else
static auto fn_ptr = pattern::first_code_match( g_csgo.m_chl.dll( ), xors( "55 8B EC 83 E4 F8 83 EC 18 56 57 8B F9 F3 0F 11 54 24" ) );
+#endif
static auto var = *( bool** )( fn_ptr + 0xda + 2 );
return *var;
}
void CCSGOPlayerAnimState::update( float yaw, float pitch ) {
+#ifdef HEADER_MODULE
+ static auto fn_ptr = g_header.patterns.animstate_update;
+#else
static auto fn_ptr = pattern::first_code_match( g_csgo.m_chl.dll( ), xors( "55 8B EC 83 E4 F8 83 EC 18 56 57 8B F9 F3 0F 11 54 24" ) );
+#endif
uintptr_t alloc = ( uintptr_t )this;
if( !alloc )
@@ -415,14 +423,24 @@ int c_base_player::get_seq_activity( int sequence ) {
}
void c_base_player::set_abs_angles( vec3_t angles ) {
+#ifdef HEADER_MODULE
+ static uintptr_t fn_ptr = g_header.patterns.set_abs_angles;
+#else
static uintptr_t fn_addr = pattern::first_code_match( g_csgo.m_chl.dll( ), xors( "55 8B EC 83 E4 F8 83 EC 64 53 56 57 8B F1 E8" ) );
+#endif
+
auto fn = ( void( __thiscall* )( void*, vec3_t& ) )( fn_addr );
return fn( this, angles );
}
void c_base_player::set_abs_origin( vec3_t origin ) {
+#ifdef HEADER_MODULE
+ static uintptr_t fn_ptr = g_header.patterns.set_abs_origin;
+#else
static uintptr_t fn_addr = pattern::first_code_match( g_csgo.m_chl.dll( ), xors( "55 8B EC 83 E4 F8 51 53 56 57 8B F1" ) );
+#endif
+
auto fn = ( void( __thiscall* )( void*, vec3_t& ) )( fn_addr );
return fn( this, origin );
@@ -524,9 +542,6 @@ void c_base_player::restore_anim_data( bool layers ) {
}
void c_base_player::do_ent_interpolation( bool reset ) {
-// return; //cuck
-
-
auto idx = ce( )->GetIndex( );
auto* anim_data = &sm_animdata[ idx ];
@@ -668,7 +683,12 @@ void c_base_player::calc_anim_velocity( bool reset ) {
}
void c_base_player::calc_abs_velocity( ) {
+#ifdef HEADER_MODULE
+ static auto fn_ptr = g_header.patterns.calc_abs_velocity;
+#else
static auto fn_ptr = pattern::first_code_match( g_csgo.m_chl.dll( ), xors( "55 8B EC 83 E4 F8 83 EC 1C 53 56 57 8B F9 F7 87" ), 0 );
+#endif
+
if( fn_ptr ) {
auto fn = ( void( __thiscall* )( void* ) )( fn_ptr );
fn( this );