From 3d412a4b30a9f7c7f51ea6562e694315948bd3da Mon Sep 17 00:00:00 2001 From: boris Date: Wed, 28 Nov 2018 16:00:02 +1300 Subject: 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 --- cheat/tf2/CBaseWeapon.cpp | 69 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 cheat/tf2/CBaseWeapon.cpp (limited to 'cheat/tf2/CBaseWeapon.cpp') diff --git a/cheat/tf2/CBaseWeapon.cpp b/cheat/tf2/CBaseWeapon.cpp new file mode 100644 index 0000000..b9881d1 --- /dev/null +++ b/cheat/tf2/CBaseWeapon.cpp @@ -0,0 +1,69 @@ +#include "CBaseWeapon.h" +#include "interfaces.h" + +int c_base_weapon::get_max_clip_1( ) { + return call_vfunc< int( __thiscall* )( void* ) >( this, 318 )( this ); +} + +int c_base_weapon::get_max_clip_2( ) { + return call_vfunc< int( __thiscall* )( void* ) >( this, 319 )( this ); +} + +int c_base_weapon::get_slot( ) { + return call_vfunc< int( __thiscall* )( void* ) >( this, 327 )( this ); +} + +char* c_base_weapon::get_name( ) { + return call_vfunc< char *( __thiscall* )( void* ) >( this, 329 )( this ); +} + +char* c_base_weapon::get_print_name( ) { + return call_vfunc< char *( __thiscall* )( void* ) >( this, 330 )( this ); +} + +vec3_t& c_base_weapon::get_bullet_spread( ) { + return call_vfunc< vec3_t& ( __thiscall* )( void* ) >( this, 286 )( this ); +} + +float c_base_weapon::get_spread( ) { + return call_vfunc< float( __thiscall* )( void* ) >( this, 455 )( this ); +} + +int c_base_weapon::get_weaponid( ) { + return call_vfunc< int( __thiscall* )( void* ) >( this, 422 )( this ); +} + +bool c_base_weapon::can_fire( ) { + auto cur_time = g_ctx.m_local->get_tick_base( ) * cl.m_globals->interval_per_tick; + auto next_primary_attack = m_flNextPrimaryAttack( ); + return cur_time >= next_primary_attack; +} + +bool c_base_weapon::is_non_aim( ) { + if ( get_slot( ) >= 2 ) return true; + //more checks to be added + return false; +} + +int& c_base_weapon::get_inspect_stage( ) { + return m_nInspectStage( ); +} + +float& c_base_weapon::get_inspect_time( ) { + return m_flInspectAnimTime( ); +} + +c_attribute_list* c_base_weapon::get_attribute_list( ) { + return reinterpret_cast< c_attribute_list* >( this + 0xA8 ); +} + +float c_base_weapon::get_distance( ) { + + if( is_melee( ) ) + return 100.f; + + if( is_flame_thrower( ) ) + return 185.f; + + return 8012.f; +} -- cgit v1.2.3