summaryrefslogtreecommitdiff
path: root/internal_rewrite/ragebot_antiaim.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'internal_rewrite/ragebot_antiaim.cpp')
-rw-r--r--internal_rewrite/ragebot_antiaim.cpp63
1 files changed, 50 insertions, 13 deletions
diff --git a/internal_rewrite/ragebot_antiaim.cpp b/internal_rewrite/ragebot_antiaim.cpp
index f172285..d8ada3c 100644
--- a/internal_rewrite/ragebot_antiaim.cpp
+++ b/internal_rewrite/ragebot_antiaim.cpp
@@ -87,14 +87,55 @@ namespace features
void c_ragebot::c_lby_breaker::update_animstate( ) {
+ if( !g_settings.rage.anti_aim( ) )
+ return;
+
+ if( !g_ctx.m_local->get_animstate( ) )
+ return;
+
auto cl = g_csgo.m_global_state->get_client_state( );
if( !cl )
return;
- if( g_cheat.m_lagmgr.get_choked( ) )
+ if( g_cheat.m_lagmgr.get_choked( ) != 1 )
return;
- bool moving = g_ctx.m_local->get_animstate( )->m_velocity >= 0.1f && g_ctx.m_local->get_animstate( )->m_bOnGround;
+ float backup_curtime = g_csgo.m_globals->m_curtime;
+ float backup_frametime = g_csgo.m_globals->m_frametime;
+
+ g_csgo.m_globals->m_curtime = g_ctx.pred_time( );
+ g_csgo.m_globals->m_frametime = TICK_INTERVAL( );
+
+ vec3_t real_angle = g_ctx.m_thirdperson_angle;
+
+ float pitch;
+ if( g_ctx.m_local->get_animstate( )->m_bInHitGroundAnimation && ( g_ctx.m_local->m_fFlags( ) & FL_ONGROUND ) ) {
+ bool dist = g_settings.rage.enabled( ) && g_settings.rage.selection_type( ) == 1;
+ int target = util::get_closest_player( dist );
+
+ if( target != -1 ) {
+ auto t = g_csgo.m_entlist( )->GetClientEntity( target );
+
+ pitch = math::vector_angles( g_ctx.m_local->m_vecOrigin( ), t->m_vecOrigin( ) ).x;
+ }
+ else
+ pitch = -10.f;
+
+ real_angle.x = pitch;
+ }
+
+ g_ctx.m_local->get_animstate( )->m_iLastClientSideAnimationUpdateFramecount -= 1;
+
+ g_ctx.m_local->get_animstate( )->update( real_angle.y, real_angle.x );
+ g_ctx.m_local->cache_anim_data( );
+
+ g_csgo.m_globals->m_curtime = backup_curtime;
+ g_csgo.m_globals->m_frametime = backup_frametime;
+
+ if( g_ctx.m_local->get_animstate( )->m_velocity < 0.1f )
+ g_ctx.m_local->get_animstate( )->m_velocity = 0.f;
+
+ bool moving = g_ctx.m_local->get_animstate( )->m_velocity > 0.1f && g_ctx.m_local->get_animstate( )->m_bOnGround;
float time = g_ctx.pred_time( );
if( moving ) {
@@ -172,14 +213,14 @@ namespace features
}
if( std::abs( offset ) < 105 ) {
- int min_tick = g_cheat.m_ragebot.m_antiaim->is_fakewalking( ) ? g_settings.rage.fakewalk_ticks( ) + 1 : 4;
- if( update_ticks < min_tick && update_ticks > 2 ) {
+ int min_tick = g_cheat.m_ragebot.m_antiaim->is_fakewalking( ) ? g_settings.rage.fakewalk_ticks( ) + 2 : 4;
+ if( update_ticks < min_tick && update_ticks >= 1 ) {
*angles = break_angle + ( offset < 0 ? 105 : -105 );
return;
}
}
- if( breaking && update_ticks < 3 ) {
+ if( breaking && update_ticks < 1 ) {
*angles = break_angle;
if( !freestanding ) {
last_angle = break_angle;
@@ -234,7 +275,7 @@ namespace features
if( !g_settings.rage.edge_dtc_normal )
return false;
- if( !( g_ctx.m_local->m_fFlags( ) & FL_ONGROUND ) )
+ if( !g_ctx.m_local->get_animstate( )->m_bOnGround )
return false;
if( g_settings.rage.edge_dtc_normal == 1 ) {
@@ -350,7 +391,7 @@ namespace features
if( !g_settings.rage.edge_detection )
return false;
- if( !( g_ctx.m_local->m_fFlags( ) & FL_ONGROUND ) )
+ if( !g_ctx.m_local->get_animstate( )->m_bOnGround )
return false;
bool is_fake = g_cheat.m_lagmgr.get_state( );
@@ -457,7 +498,7 @@ namespace features
if( !g_ctx.m_local->get_weapon( ) )
return;
- bool in_move = !( m_cmd->m_buttons & IN_FORWARD ) && !( m_cmd->m_buttons & IN_BACK ) && !( m_cmd->m_buttons & IN_LEFT ) && !( m_cmd->m_buttons & IN_RIGHT );
+ bool in_move = ( m_cmd->m_buttons & IN_FORWARD ) || ( m_cmd->m_buttons & IN_BACK ) || ( m_cmd->m_buttons & IN_LEFT ) || ( m_cmd->m_buttons & IN_RIGHT );
if( !m_cmd->m_sidemove && !m_cmd->m_forwardmove && !g_ctx.m_local->m_vecVelocity( ) && !in_move )
return;
@@ -552,10 +593,6 @@ namespace features
g_cheat.m_lagmgr.set_state( false );
}
- if( !g_ctx.m_local->m_vecVelocity( ).length2d( ) && !g_cheat.m_lagmgr.get_sent( ) && choked > max_ticks ) {
- g_cheat.m_lagmgr.set_state( true );
- }
-
if( ticks_to_stop > ticks_left - 1 || !choked ) {
quick_stop( );
}
@@ -595,7 +632,7 @@ namespace features
int setting = fake ? g_settings.rage.fake_yaw : g_settings.rage.real_yaw;
int jitter = fake ? g_settings.rage.fake_yaw_jitter : g_settings.rage.real_yaw_jitter;
int add = fake ? g_settings.rage.fake_yaw_add : g_settings.rage.real_yaw_add;
- if( !( g_ctx.m_local->m_fFlags( ) & FL_ONGROUND ) ) {
+ if( !g_ctx.m_local->get_animstate( )->m_bOnGround ) {
if( !fake && g_settings.rage.air_yaw( ) ) {
setting = g_settings.rage.air_yaw;
jitter = g_settings.rage.air_yaw_jitter;