summaryrefslogtreecommitdiff
path: root/internal_rewrite
diff options
context:
space:
mode:
Diffstat (limited to 'internal_rewrite')
-rw-r--r--internal_rewrite/create_move.cpp3
-rw-r--r--internal_rewrite/extra.cpp17
-rw-r--r--internal_rewrite/factory.hpp2
-rw-r--r--internal_rewrite/ragebot.cpp18
-rw-r--r--internal_rewrite/ragebot_antiaim.cpp10
-rw-r--r--internal_rewrite/update_clientside_animation.cpp74
6 files changed, 32 insertions, 92 deletions
diff --git a/internal_rewrite/create_move.cpp b/internal_rewrite/create_move.cpp
index c6a75c0..47232fa 100644
--- a/internal_rewrite/create_move.cpp
+++ b/internal_rewrite/create_move.cpp
@@ -76,6 +76,8 @@ bool __fastcall hooks::create_move( void* ecx_, void* edx_, float input_sample_f
// Actual implementation of RunCommand.
g_cheat.m_prediction.run_command( ucmd );
+ g_cheat.m_extra.auto_revolver( ucmd );
+
g_cheat.m_legitbot.m_lagcomp( ucmd );
g_cheat.m_legitbot.triggerbot( ucmd );
@@ -84,7 +86,6 @@ bool __fastcall hooks::create_move( void* ecx_, void* edx_, float input_sample_f
g_cheat.m_visuals.update_hit_flags( );
g_cheat.m_ragebot( ucmd );
- g_cheat.m_extra.auto_revolver( ucmd );
g_cheat.m_extra.no_recoil( ucmd );
diff --git a/internal_rewrite/extra.cpp b/internal_rewrite/extra.cpp
index fb8564a..36a4e21 100644
--- a/internal_rewrite/extra.cpp
+++ b/internal_rewrite/extra.cpp
@@ -211,13 +211,22 @@ namespace features
static float next_time = 0.f;
auto time = g_ctx.pred_time( );
- if( g_ctx.m_local->can_attack( ) && next_time >= time ) {
- g_ctx.m_revolver_shot = false;
- cmd->m_buttons |= IN_ATTACK;
+ auto primaryattack = weapon->m_flNextPrimaryAttack( );
+ auto nextattack = g_ctx.m_local->m_flNextAttack( );
+
+ if( primaryattack < time && nextattack < time ) {
+ if( next_time >= time ) {
+ g_ctx.m_revolver_shot = false;
+ cmd->m_buttons |= IN_ATTACK;
+ }
+ else {
+ next_time = time + 0.234375f;
+ g_ctx.m_revolver_shot = true;
+ }
}
else {
+ g_ctx.m_revolver_shot = false;
next_time = time + 0.234375f;
- g_ctx.m_revolver_shot = true;
}
}
diff --git a/internal_rewrite/factory.hpp b/internal_rewrite/factory.hpp
index c81c79b..d197951 100644
--- a/internal_rewrite/factory.hpp
+++ b/internal_rewrite/factory.hpp
@@ -11,7 +11,7 @@
//IFACE_DLLMAIN - interfaces are passed through dllmain and below code doesnt need to be ran
#ifndef _DEBUG
//#define IFACE_DLLMAIN
-#define HEADER_MODULE
+//#define HEADER_MODULE
#endif
#ifdef IFACE_DLLMAIN
diff --git a/internal_rewrite/ragebot.cpp b/internal_rewrite/ragebot.cpp
index f458bdc..9e02f1b 100644
--- a/internal_rewrite/ragebot.cpp
+++ b/internal_rewrite/ragebot.cpp
@@ -453,7 +453,7 @@ namespace features
vec3_t vel = g_ctx.m_local->m_vecVelocity( );
float speed = vel.length2d( );
- if( speed < 10.f ) {
+ if( speed < 0.1f ) {
g_ctx.get_last_cmd( )->m_forwardmove = 0.f;
g_ctx.get_last_cmd( )->m_sidemove = 0.f;
return;
@@ -484,7 +484,7 @@ namespace features
}
vec3_t ndir = math::vector_angles( vel * -1.f );
- ndir.y = cmd->m_viewangles.y - ndir.y;
+ ndir.y = g_csgo.m_engine( )->GetViewAngles( ).y - ndir.y;
ndir = math::angle_vectors( ndir );
g_ctx.get_last_cmd( )->m_forwardmove = ndir.x * wishspeed;
@@ -1038,18 +1038,14 @@ namespace features
m_send_next = false;
}
- // do not
- if( g_settings.rage.silent == 2 && !g_cheat.m_lagmgr.get_choked( ) && !m_antiaim->is_fakewalking( ) ) {
- g_cheat.m_lagmgr.set_state( false );
- return;
- }
-
auto wep = g_ctx.m_local->get_weapon( );
if( !wep ) {
m_target = -1;
return;
}
+ bool is_revolver = wep->m_iItemDefinitionIndex( ) == WEAPON_R8REVOLVER;
+
bool in_attack = false;
m_can_fakeping = true;
@@ -1084,6 +1080,12 @@ namespace features
return;
}
+ // do not
+ if( g_settings.rage.silent == 2 && !g_cheat.m_lagmgr.get_choked( ) && !m_antiaim->is_fakewalking( ) && !is_revolver ) {
+ g_cheat.m_lagmgr.set_state( false );
+ return;
+ }
+
auto target = find_best_target( );
if ( target.m_ent_index != -1 ) {
aim_at_target( target );
diff --git a/internal_rewrite/ragebot_antiaim.cpp b/internal_rewrite/ragebot_antiaim.cpp
index 7db3e6e..f172285 100644
--- a/internal_rewrite/ragebot_antiaim.cpp
+++ b/internal_rewrite/ragebot_antiaim.cpp
@@ -525,7 +525,7 @@ namespace features
}
vec3_t ndir = math::vector_angles( vel * -1.f );
- ndir.y = m_cmd->m_viewangles.y - ndir.y;
+ ndir.y = g_csgo.m_engine( )->GetViewAngles( ).y - ndir.y;
ndir = math::angle_vectors( ndir );
g_ctx.get_last_cmd( )->m_forwardmove = ndir.x * wishspeed;
@@ -542,15 +542,9 @@ namespace features
predict_velocity( &velocity );
}
- // Doesn't this output some fucked up value for weapons other than the revolver?
- float time_to_shoot = g_ctx.m_local->get_weapon( )->m_flPostponeFireReadyTime( ) - g_ctx.pred_time( );
- int revolver_ticks = TIME_TO_TICKS( time_to_shoot ) - 1;
- if( revolver_ticks < -1 )
- revolver_ticks = INT_MAX;
-
int update_ticks = m_breaker.get_next_update( ) - 1;
- const int max_ticks = math::min< int >( g_settings.rage.fakewalk_ticks, update_ticks, revolver_ticks );
+ const int max_ticks = math::min< int >( g_settings.rage.fakewalk_ticks, update_ticks );
const int choked = g_cheat.m_lagmgr.get_choked( );
int ticks_left = max_ticks - choked;
diff --git a/internal_rewrite/update_clientside_animation.cpp b/internal_rewrite/update_clientside_animation.cpp
index fb4ab72..d61916a 100644
--- a/internal_rewrite/update_clientside_animation.cpp
+++ b/internal_rewrite/update_clientside_animation.cpp
@@ -13,10 +13,8 @@ void __fastcall hooks::update_clientside_animation( void* ecx_, void* edx_ ) {
auto ent = ( c_base_player* )( ecx_ );
static ent_animdata_t prev_anims;
- static float last_choke;
static float last_update;
static float last_spawntime = 0.f;
- static float last_yaw;
// Arbitrary number much.
if( !g_settings.rage.anti_aim || !g_ctx.m_local->is_valid( ) || std::abs( last_update - g_csgo.m_globals->m_curtime ) > TICKS_TO_TIME( 20 ) || last_spawntime != ent->m_flSpawnTime( ) ) {
@@ -33,18 +31,19 @@ void __fastcall hooks::update_clientside_animation( void* ecx_, void* edx_ ) {
if( !g_cheat.m_lagmgr.get_choked( ) || g_cheat.m_lagmgr.get_sent( ) > 1 || first_update ) {
vec3_t backup;
g_csgo.m_prediction( )->GetLocalViewAngles( backup );
+
float backup_curtime = g_csgo.m_globals->m_curtime;
float backup_frametime = g_csgo.m_globals->m_frametime;
+ last_update = backup_curtime;
+
g_csgo.m_globals->m_curtime = g_ctx.pred_time( );
g_csgo.m_globals->m_frametime = TICK_INTERVAL( );
if( g_csgo.m_globals->m_curtime != ent->get_animstate( )->m_flLastClientSideAnimationUpdateTime ) {
last_update = backup_curtime;
- last_choke = std::max( g_csgo.m_globals->m_curtime - ent->get_animstate( )->m_flLastClientSideAnimationUpdateTime, TICK_INTERVAL( ) );
-
vec3_t real_angle = g_ctx.m_thirdperson_angle;
float pitch;
@@ -63,16 +62,9 @@ void __fastcall hooks::update_clientside_animation( void* ecx_, void* edx_ ) {
real_angle.x = pitch;
}
- last_yaw = ent->get_animstate( )->m_flGoalFeetYaw;
- if( last_yaw < 0.f )
- last_yaw += 360.f;
-
- g_csgo.m_prediction( )->SetViewAngles( real_angle );
ent->get_animstate( )->update( real_angle.y, real_angle.x );
old_func( ecx_, edx_ );
- memcpy( &prev_anims, &ent->get_animdata( ), sizeof( prev_anims ) );
- prev_anims.m_last_simtime = last_yaw;
ent->cache_anim_data( );
}
@@ -83,67 +75,9 @@ void __fastcall hooks::update_clientside_animation( void* ecx_, void* edx_ ) {
ent->restore_anim_data( true );
- float lerp = std::min( last_choke, TICK_INTERVAL( ) * 2.f );
- float update_delta = last_choke;
- float update_lerp = std::clamp( update_delta - lerp, 0.f, 1.f );
- if( update_delta > 0.f )
- lerp = std::clamp( lerp, 0.f, update_delta );
-
- float lerp_progress = ( last_update + lerp - g_csgo.m_globals->m_curtime ) / lerp;
-
- float lerp_yaw = 0.f;
- if( !first_update && ( ent->get_animstate( )->m_velocity > 0.1f || std::abs( last_yaw - ent->get_animstate( )->m_flGoalFeetYaw ) < 35.f ) && update_delta <= TICK_INTERVAL( ) * 2.f ) {
- float yaw = ent->get_animstate( )->m_flGoalFeetYaw;
- if( yaw < 0.f )
- yaw += 360.f;
-
- if( std::abs( yaw - last_yaw ) >= 180.f )
- lerp_yaw = yaw;
- else {
- lerp_yaw = math::lerp( yaw, last_yaw, std::clamp( lerp_progress, 0.f, 1.f ) );
- }
- }
- else {
- lerp_yaw = ent->get_animstate( )->m_flGoalFeetYaw;
- }
-
- //interpolate EVERYTHING
- if( !first_update && !( ent->get_animstate( )->m_bInHitGroundAnimation && ent->get_animstate( )->m_bOnGround ) ) {
- for( size_t i{ }; i < 18; ++i ) {
- float old_param = prev_anims.m_poseparams.at( i );
- float param = ent->get_animdata( ).m_poseparams.at( i );
-
- if( i == BODY_YAW )
- continue;
-
- if( !isfinite( old_param ) || !isfinite( param ) )
- continue;
-
- float final_param = math::lerp( param, old_param, std::clamp( lerp_progress, 0.f, 1.f ) );
-
- ent->m_flPoseParameter( )[ i ] = final_param;
- }
-
- for( size_t i{ }; i < 13; ++i ) {
- auto old_cycle = prev_anims.m_animlayers.at( i ).m_flCycle;
- auto cycle = ent->get_animdata( ).m_animlayers.at( i ).m_flCycle;
-
- if( old_cycle > 0.9f && cycle < 0.1f ) {
- cycle += 1.f;
- }
-
- float final_cycle = math::lerp( cycle, old_cycle, std::clamp( lerp_progress, 0.f, 1.f ) );
-
- if( final_cycle > 1.f )
- final_cycle -= 1.f;
-
- ent->m_AnimOverlay( ).GetElements( )[ i ].m_flCycle = final_cycle;
- }
- }
-
if( !first_update ) {
//*( byte* )( uintptr_t( ent ) + 0x270 ) = 0;
- ent->set_abs_angles( vec3_t( 0, lerp_yaw, 0 ) );
+ ent->set_abs_angles( vec3_t( 0, ent->get_animstate( )->m_flGoalFeetYaw, 0 ) );
bool backup = ent->get_animstate( )->m_bOnGround;
ent->get_animstate( )->m_bOnGround = false;