diff options
Diffstat (limited to 'internal_rewrite/proxies.cpp')
| -rw-r--r-- | internal_rewrite/proxies.cpp | 116 |
1 files changed, 0 insertions, 116 deletions
diff --git a/internal_rewrite/proxies.cpp b/internal_rewrite/proxies.cpp deleted file mode 100644 index 287970b..0000000 --- a/internal_rewrite/proxies.cpp +++ /dev/null @@ -1,116 +0,0 @@ -#include "hooks.hpp"
-#include "context.hpp"
-#include "base_cheat.hpp"
-
-void __cdecl hooks::lby_proxy_fn( const CRecvProxyData* proxy_data_const, void* entity, void* output ) {
- lby_proxy.get_old_function( )( proxy_data_const, entity, output );
-
- if( !g_csgo.m_panic ) {
- auto player = ( c_base_player* )( entity );
- if( player && player == g_ctx.m_local ) {
- g_cheat.m_ragebot.m_antiaim->on_lby_proxy( );
- }
- }
-}
-
-void __cdecl hooks::last_shot_proxy_fn( const CRecvProxyData* proxy_data_const, void* entity, void* output ) {
- last_shot_proxy.get_old_function( )( proxy_data_const, entity, output );
- if( !g_csgo.m_panic && proxy_data_const && g_settings.rage.enabled( ) && g_settings.rage.resolver( ) ) {
- auto wep = ( c_base_weapon* )( entity );
- if( wep && !wep->is_knife( ) && !wep->is_grenade( ) ) {
- auto owner = g_csgo.m_entlist( )->GetClientEntityFromHandle( wep->m_hOwner( ) );
- if( owner && owner->is_valid( ) && owner != g_ctx.m_local && g_ctx.m_local->is_valid( ) && owner->has_valid_anim( ) ) {
- if( owner->m_iTeamNum( ) == g_ctx.m_local->m_iTeamNum( ) && !g_settings.rage.friendlies )
- return;
-
- static float last_time = 0.f;
- float time = wep->m_fLastShotTime( );
-
- if( !time )
- return;
-
- float anim_time = owner->m_flOldSimulationTime( ) + TICK_INTERVAL( );
- auto record = g_cheat.m_ragebot.m_lagcomp->get_newest_record( owner->ce( )->GetIndex( ) );
- float& last_update = g_cheat.m_ragebot.m_lagcomp->get_last_updated_simtime( owner->ce( )->GetIndex( ) );
-
- if( time == anim_time && owner->has_valid_anim( ) && owner->m_flSimulationTime( ) != last_update ) {
- last_update = owner->m_flSimulationTime( );
-
- vec3_t local_pos = g_ctx.m_local->m_vecOrigin( );
- vec3_t enemy_pos = owner->m_vecOrigin( );
- vec3_t ang = math::vector_angles( enemy_pos, local_pos );
-
- owner->m_angEyeAngles( ).y = ang.y;
- owner->fix_animations( );
-
- features::c_ragebot::lag_record_t record( owner );
- record.m_shot = true;
-
- g_cheat.m_ragebot.m_lagcomp->store_record( owner->ce( )->GetIndex( ), RECORD_NORMAL, record );
- last_time = time;
- }
- else if( owner->has_valid_anim( ) && time != last_time ) {
- auto lby_records = g_cheat.m_ragebot.m_lagcomp->get_records( owner->ce( )->GetIndex( ), RECORD_LBY );
- auto sim_records = g_cheat.m_ragebot.m_lagcomp->get_records( owner->ce( )->GetIndex( ), RECORD_NORMAL );
-
- features::c_ragebot::lag_record_t* prev_record = nullptr;
- float min_delta = FLT_MAX;
-
- if( lby_records->size( ) ) {
- for( auto& it : *lby_records ) {
- float delta = std::abs( it.m_flSimulationTime - time );
- if( delta > TICKS_TO_TIME( 15 ) )
- break;
-
- if( delta < g_csgo.m_globals->m_interval_per_tick )
- break;
-
- if( delta < min_delta ) {
- prev_record = ⁢
- min_delta = delta;
- }
- }
- }
-
- if( sim_records->size( ) ) {
- for( auto& it : *sim_records ) {
- if( it.m_shot )
- continue;
-
- float delta = std::abs( it.m_flSimulationTime - time );
- if( delta > TICKS_TO_TIME( 15 ) )
- break;
-
- if( delta < g_csgo.m_globals->m_interval_per_tick )
- break;
-
- if( delta < min_delta ) {
- prev_record = ⁢
- min_delta = delta;
- }
- }
- }
-
- if( prev_record && !prev_record->m_shot ) {
- owner->m_angEyeAngles( ).x = prev_record->m_vecAngles.x;
- }
-
- last_time = time;
- }
- }
- }
- }
-}
-
-void __cdecl hooks::simtime_proxy_fn( const CRecvProxyData* proxy_data_const, void* entity, void* output ) {
- auto old_fn = simtime_proxy.get_old_function( );
-
- auto ent = ( c_base_player* )( entity );
- if( ent && ent->is_valid( ) && ent->has_valid_anim( ) && ( ent->m_iTeamNum( ) != g_ctx.m_local->m_iTeamNum( ) || g_settings.rage.friendlies( ) ) && ent != g_ctx.m_local ) {
- if( !proxy_data_const->m_Value.m_Int ) {
- return;
- }
- }
-
- old_fn( proxy_data_const, entity, output );
-}
\ No newline at end of file |
