summaryrefslogtreecommitdiff
path: root/cheat/internal_rewrite/ragebot_antiaim.cpp
diff options
context:
space:
mode:
authornavewindre <boneyaard@gmail.com>2018-12-24 00:36:10 +0100
committernavewindre <boneyaard@gmail.com>2018-12-24 00:36:10 +0100
commitf41bf6509390f12a4252f40daf0209e7a7d64666 (patch)
tree79ed2c592ee15bc0e97a6d2f9c2a92226281009e /cheat/internal_rewrite/ragebot_antiaim.cpp
parentfef68b3881d7b1a60abe2be85dde27b7b0ada3c3 (diff)
d
Diffstat (limited to 'cheat/internal_rewrite/ragebot_antiaim.cpp')
-rw-r--r--cheat/internal_rewrite/ragebot_antiaim.cpp59
1 files changed, 31 insertions, 28 deletions
diff --git a/cheat/internal_rewrite/ragebot_antiaim.cpp b/cheat/internal_rewrite/ragebot_antiaim.cpp
index 0e05e8a..4e7f185 100644
--- a/cheat/internal_rewrite/ragebot_antiaim.cpp
+++ b/cheat/internal_rewrite/ragebot_antiaim.cpp
@@ -86,6 +86,23 @@ namespace features
}*/
+ float c_ragebot::c_antiaim::desync_delta( ) {
+ auto state = g_ctx.m_local->get_animstate( );
+
+ float duck_amt = state->m_fDuckAmount;
+ float speed_fraction = std::clamp( state->m_flFeetSpeedForwardsOrSideWays, 0.f, 1.f );
+ float speed_factor = std::clamp( state->m_flFeetSpeedUnknownForwardOrSideways, 0.f, 1.f );
+
+ float unk = ( *( float* )( uintptr_t( state ) + 0x11c ) * -0.30000001f - 0.19999999f ) * speed_fraction + 1.f;
+ if( duck_amt > 0.f )
+ unk += ( ( duck_amt * speed_factor ) * ( 0.5f - unk ) );
+
+ //not exact but who cares
+ float max_delta = 57.5f * unk;
+
+ return max_delta;
+ }
+
void c_ragebot::c_lby_breaker::update_animstate( ) {
if( !g_settings.rage.anti_aim( ) )
return;
@@ -119,7 +136,11 @@ namespace features
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( );
+
+ if( !g_cheat.m_lagmgr.get_state( ) ) {
+ g_ctx.m_absyaw = g_ctx.m_local->get_animstate( )->m_flGoalFeetYaw;
+ g_ctx.m_local->cache_anim_data( );
+ }
g_csgo.m_globals->m_curtime = backup_curtime;
g_csgo.m_globals->m_frametime = backup_frametime;
@@ -208,7 +229,7 @@ namespace features
}
if( std::abs( offset ) < 105 ) {
- int min_tick = g_cheat.m_ragebot.m_antiaim->is_fakewalking( ) ? g_settings.rage.fakewalk_ticks( ) + 2 : 4;
+ int min_tick = 3;
if( update_ticks < min_tick && update_ticks >= 1 ) {
*angles = break_angle + ( offset < 0 ? 105 : -105 );
return;
@@ -537,7 +558,7 @@ namespace features
}
if( is_fake ) {
- aim_angle.y -= 50.f;
+ aim_angle.y -= desync_delta( );
}
else {
int jitter = g_settings.rage.edge_dtc_real_jitter;
@@ -789,6 +810,10 @@ namespace features
float step = float( g_settings.rage.angle_step_degrees( ) );
original = math::find_closest_step( original, step );
}
+
+ if( is_fake && g_ctx.m_local->m_fFlags( ) & FL_ONGROUND )
+ return g_ctx.m_last_realangle.y - desync_delta( );
+
return get_yaw( is_fake, original, no_jitter );
}
@@ -870,32 +895,10 @@ namespace features
freestanding = run_freestanding( );
}
- m_is_edging = freestanding || edge_detected;
-
- if( g_settings.rage.break_lby( ) && ( !m_is_edging || g_settings.rage.break_lby_edge ) ) {
- float yaw;
-
- if( m_is_edging ) {
- auto target = util::get_closest_player( );
- if( target != -1 ) {
- auto ent = g_csgo.m_entlist( )->GetClientEntity< >( target );
-
- vec3_t ang = math::vector_angles(
- ent->m_vecOrigin( ),
- g_ctx.m_local->m_vecOrigin( ) );
-
- yaw = std::remainderf( ang.y + ( m_direction ? -90.f : 90.f ), 360.f );
- }
- }
- else {
- yaw = get_yaw( true );
- }
+ if( m_breaker.get_next_update( ) < 0 && !g_cheat.m_lagmgr.get_state( ) )
+ m_cmd->m_viewangles.y = g_ctx.m_last_realangle.y + 115.f;
- m_breaker.override_angles( &m_cmd->m_viewangles.y,
- yaw,
- std::remainderf( 180.f - float( g_settings.rage.lby_delta ), 360.f ),
- freestanding );
- }
+ m_is_edging = freestanding || edge_detected;
if( g_cheat.m_lagmgr.get_state( ) && !g_settings.rage.fake_yaw( ) )
m_cmd->m_viewangles.y = g_csgo.m_engine( )->GetViewAngles( ).y;