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/tf2/CBaseWeapon.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/tf2/CBaseWeapon.cpp')
| -rw-r--r-- | cheat/tf2/CBaseWeapon.cpp | 69 |
1 files changed, 69 insertions, 0 deletions
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;
+}
|
