From d1cab43b8ffd1fd37633e4751818d14c840ecef9 Mon Sep 17 00:00:00 2001 From: navewindre Date: Mon, 17 Sep 2018 20:09:00 +0200 Subject: d --- internal_rewrite/c_base_player.cpp | 26 +++- internal_rewrite/c_base_player.hpp | 3 + internal_rewrite/draw_model_execute.cpp | 3 + internal_rewrite/ragebot.cpp | 12 +- internal_rewrite/ragebot.hpp | 37 ++--- internal_rewrite/ragebot_antiaim.cpp | 6 +- internal_rewrite/ragebot_lagcomp.cpp | 5 + internal_rewrite/ragebot_resolver.cpp | 237 +++++++++++++++----------------- internal_rewrite/visual_player.cpp | 4 +- 9 files changed, 174 insertions(+), 159 deletions(-) (limited to 'internal_rewrite') diff --git a/internal_rewrite/c_base_player.cpp b/internal_rewrite/c_base_player.cpp index 47f9e36..ee478a7 100644 --- a/internal_rewrite/c_base_player.cpp +++ b/internal_rewrite/c_base_player.cpp @@ -351,8 +351,8 @@ bool c_base_player::is_fakewalking( ) { auto velocity = m_vecVelocity( ).length2d( ); bool on_ground = m_fFlags( ) & FL_ONGROUND; - if( walk_layer.m_flWeight < 0.3f - && some_layer.m_flWeight < 0.2f + if( walk_layer.m_flWeight < 0.1f + && some_layer.m_flWeight < 0.1f && velocity > 0.1f && on_ground ) { return true; } @@ -736,7 +736,7 @@ void c_base_player::calc_anim_velocity( bool reset ) { int ticks = TIME_TO_TICKS( delta * 0.5f ); vec3_t est_tick_vel = math::lerp( last_velocity, velocity, .5f ); for( int i{ }; i < ticks + 1; i++ ) { - if( est_tick_vel.length2d( ) < 1.f ) + if( est_tick_vel.length2d( ) < 5.f ) break; est_tick_vel = friction( est_tick_vel ); @@ -883,6 +883,18 @@ void c_base_player::fix_animations( bool reset, bool resolver_change ) { float prev_cycle = m_AnimOverlay( ).GetElements( )[ 6 ].m_flPrevCycle; float prev_rate = m_AnimOverlay( ).GetElements( )[ 6 ].m_flPlaybackRate; + /*needs testing but seems to work*/ + if( !reset ) { + auto& layer = m_AnimOverlay( ).GetElements( )[ 3 ]; + + int sequence = get_seq_activity( layer.m_nSequence ); + + if( sequence == 979 ) { + //if( sm_animdata[ idx ].m_adjust_cycle + sm_animdata[ idx ].m_adjust_rate >= 1.f ) + // eye_angles.y = m_flLowerBodyYawTarget( ); + } + } + get_animstate( )->update( eye_angles.y, eye_angles.x ); m_AnimOverlay( ).GetElements( )[ 6 ].m_flPrevCycle = m_AnimOverlay( ).GetElements( )[ 6 ].m_flCycle; @@ -914,10 +926,14 @@ void c_base_player::fix_animations( bool reset, bool resolver_change ) { //check for any possible mistakes validate_animation_layers( ); + sm_animdata[ idx ].m_adjust_rate = m_AnimOverlay( ).GetElements( )[ 3 ].m_flPlaybackRate; + sm_animdata[ idx ].m_adjust_cycle = m_AnimOverlay( ).GetElements( )[ 3 ].m_flCycle; + if( m_flSimulationTime( ) - m_flOldSimulationTime( ) > TICK_INTERVAL( ) ) { auto activity = get_seq_activity( m_AnimOverlay( ).GetElements( )[ 3 ].m_nSequence ); if( activity == 979 ) { + m_AnimOverlay( ).GetElements( )[ 3 ].m_flWeight = 0.f; m_AnimOverlay( ).GetElements( )[ 3 ].m_flCycle = 0.f; } } @@ -925,13 +941,13 @@ void c_base_player::fix_animations( bool reset, bool resolver_change ) { bool moving = sm_animdata[ idx ].m_anim_velocity.length( ) > 0.1f; //compute_move_cycle( reset, moving ); - - if( is_fakewalking( ) && !reset ) { //sm_animdata[ idx ].m_last_velocity = vec3_t( ); //sm_animdata[ idx ].m_anim_velocity = vec3_t( ); } + get_animdata( ).m_anim_flags = m_fFlags( ); + if( !moving ) m_AnimOverlay( ).GetElements( )[ 6 ].m_flWeight = 0.f; diff --git a/internal_rewrite/c_base_player.hpp b/internal_rewrite/c_base_player.hpp index bf8a9c0..d41fe82 100644 --- a/internal_rewrite/c_base_player.hpp +++ b/internal_rewrite/c_base_player.hpp @@ -239,6 +239,9 @@ struct ent_animdata_t { bool m_valid{ }; float m_last_duck; int m_prev_flags; + int m_anim_flags; + float m_adjust_rate; + float m_adjust_cycle; }; class c_base_player { diff --git a/internal_rewrite/draw_model_execute.cpp b/internal_rewrite/draw_model_execute.cpp index dac41ac..bd5b5fc 100644 --- a/internal_rewrite/draw_model_execute.cpp +++ b/internal_rewrite/draw_model_execute.cpp @@ -43,6 +43,9 @@ void __fastcall hooks::draw_model_execute( IVModelRender* ecx_, void* edx_, is_player = true; team = player->m_iTeamNum( ); + if( g_settings.rage.active && ( team != local_team || g_settings.rage.friendlies ) && !player->has_valid_anim( ) ) + return; + if( is_player ) { bool should_draw = false; if( g_settings.rage.enabled( ) && g_settings.rage.resolver( ) && g_settings.rage.bt_visualize( ) && ( team != local_team || g_settings.rage.friendlies( ) ) ) diff --git a/internal_rewrite/ragebot.cpp b/internal_rewrite/ragebot.cpp index b0f6c13..6aefbd1 100644 --- a/internal_rewrite/ragebot.cpp +++ b/internal_rewrite/ragebot.cpp @@ -292,7 +292,6 @@ namespace features constexpr std::array< std::pair< PlayerHitboxes_t, int >, 15 > hitbox_order = { std::make_pair( HITBOX_HEAD, 3 ), - std::make_pair( HITBOX_NECK, 3 ), std::make_pair( HITBOX_PELVIS, 3 ), std::make_pair( HITBOX_BODY, 3 ), @@ -300,6 +299,8 @@ namespace features std::make_pair( HITBOX_CHEST, 3 ), std::make_pair( HITBOX_UPPER_CHEST, 3 ), + std::make_pair( HITBOX_NECK, 2 ), + std::make_pair( HITBOX_RIGHT_HAND, 2 ), std::make_pair( HITBOX_LEFT_HAND, 2 ), @@ -316,7 +317,7 @@ namespace features bool moving = ent->m_vecVelocity( ).length( ) > 0.1f && !ent->is_fakewalking( ); float min_dmg = get_min_dmg( ent ); - if ( g_settings.rage.hitbox != -1 ) { + if( g_settings.rage.hitbox != -1 ) { float dmg{ }; vec3_t pos = multipoint( ent, g_settings.rage.hitbox, &dmg ); @@ -466,9 +467,12 @@ namespace features max_speed = g_ctx.m_local->get_weapon( )->get_wpn_info( )->max_speed_alt; } + // thx ida + max_speed = std::min< float >( max_speed, 250.f ); + if( g_ctx.m_local->m_fFlags( ) & FL_DUCKING ) { - max_speed /= 3.f; - accel /= 3.f; + // max_speed /= 3.f; + // accel /= 3.f; } float surf_friction = 1.f; diff --git a/internal_rewrite/ragebot.hpp b/internal_rewrite/ragebot.hpp index 8a7e856..1c4e7ed 100644 --- a/internal_rewrite/ragebot.hpp +++ b/internal_rewrite/ragebot.hpp @@ -160,6 +160,7 @@ namespace features float m_flDuckSpeed{ }; float m_animDuck{ }; int m_fFlags{ }; + int m_animFlags{ }; vec3_t m_animVelocity{ }; vec3_t m_prevVelocity{ }; @@ -258,10 +259,11 @@ namespace features user_cmd_t* m_cmd; }; - enum BreakingState_t { - BREAKING_NONE, - BREAKING, - BREAKING_LAST, + enum ResolverState_t { + R_NONE, + R_NORMAL, + R_FREESTANDING, + R_LAST, }; enum OverrideDir_t { @@ -286,17 +288,10 @@ namespace features int manual_override( c_base_player* ); void force_lby( c_base_player* ); void on_missed_spread( int ent_index, int shots ); + int try_freestanding( c_base_player* ); void update_player( int i ); - __forceinline bool is_breaking_lby( int ent_index ) { - return !!m_data[ ent_index ].m_breaking; - } - - __forceinline int get_breaking_state( int ent_index ) { - return m_data[ ent_index ].m_breaking; - } - void increment_shots( int ent_index ); __forceinline int get_shots( int ent_index ) { @@ -309,6 +304,16 @@ namespace features return m_data[ ent_index ].m_angle_change; } + __forceinline int get_state( int ent_index ) { + return m_data[ ent_index ].m_state; + } + + __forceinline int& get_resolver_shots( int ent_index ) { + auto& data = m_data[ ent_index ]; + + return data.m_shots[ data.m_state ]; + } + protected: struct resolve_log_t { @@ -316,19 +321,19 @@ namespace features void update( int ent_index ); void reset( ); - bool m_logged{ }; + bool m_logged[ R_LAST ]{ }; float m_logged_lby{ }; - int m_breaking{ }; + int m_state{ }; float m_last_lby{ }; float m_last_moving_lby{ }; float m_last_update{ }; - int m_shots{ }; + int m_shots[ R_LAST ]{ }; bool m_was_invalid{ }; bool m_has_valid_lby{ }; int m_last_freestanding{ }; int m_overriding{ }; int m_missed_shots{ }; - int m_logged_shots{ }; + int m_logged_shots[ R_LAST ]{ }; bool m_angle_change{ }; vec3_t m_last_pos{ }; }; diff --git a/internal_rewrite/ragebot_antiaim.cpp b/internal_rewrite/ragebot_antiaim.cpp index 5a9186c..efd8af3 100644 --- a/internal_rewrite/ragebot_antiaim.cpp +++ b/internal_rewrite/ragebot_antiaim.cpp @@ -441,19 +441,19 @@ namespace features float dmg_right = get_damage( enemy_left, local_right, ent, g_ctx.m_local ) + get_damage( enemy_right, local_right, ent, g_ctx.m_local ); - if( std::abs( dmg_left - dmg_right ) < 50.f ) + if( std::abs( dmg_left - dmg_right ) < 25.f ) return false; float max_dmg = math::max( dmg_left, dmg_right ); direction = dmg_left > dmg_right; cur_damage = max_dmg; - return max_dmg > 50.f; + return max_dmg > 25.f; }; float radius = ( g_ctx.m_local->get_hitbox_pos( 0 ) - g_ctx.m_local->m_vecOrigin( ) ).length2d( ); - if( !test_dmg( radius ) ) { + if( !test_dmg( radius + 1.f ) ) { if( cur_damage < start_dmg * 2.f ) return false; } diff --git a/internal_rewrite/ragebot_lagcomp.cpp b/internal_rewrite/ragebot_lagcomp.cpp index b9a072a..e961b15 100644 --- a/internal_rewrite/ragebot_lagcomp.cpp +++ b/internal_rewrite/ragebot_lagcomp.cpp @@ -25,6 +25,7 @@ namespace features m_prevVelocity = m_ent->get_animdata( ).m_last_velocity; m_flDuckSpeed = m_ent->m_flDuckSpeed( ); m_flDuckAmount = m_ent->m_flDuckAmount( ); + m_animFlags = m_ent->get_animdata( ).m_anim_flags; m_vecHeadPos = ent->get_hitbox_pos( 0 ); m_vecPelvisPos = ent->get_hitbox_pos( HITBOX_PELVIS ); @@ -128,9 +129,13 @@ namespace features m_ent->m_flDuckSpeed( ) = m_flDuckSpeed; m_ent->m_flDuckAmount( ) = m_animDuck; + m_ent->m_fFlags( ) = m_animFlags; + m_state.m_flLastClientSideAnimationUpdateTime = m_flOldSimulationTime; m_state.update( m_ent->m_angEyeAngles( ).y, m_ent->m_angEyeAngles( ).x ); + m_ent->m_fFlags( ) = m_fFlags; + m_ent->m_flDuckAmount( ) = backup_duck; m_ent->m_flDuckSpeed( ) = backup_duckspeed; diff --git a/internal_rewrite/ragebot_resolver.cpp b/internal_rewrite/ragebot_resolver.cpp index a35a55d..3bf3955 100644 --- a/internal_rewrite/ragebot_resolver.cpp +++ b/internal_rewrite/ragebot_resolver.cpp @@ -25,15 +25,19 @@ namespace features FLT_ANG_135, }; - - static const std::vector< float > possible_angles_adjust = { - FLT_ANG_FREESTANDING, + static const std::vector< float > possible_angles_normal = { FLT_ANG_MOVING_LBY_UP, - FLT_ANG_180, + FLT_ANG_180, FLT_ANG_135, - FLT_ANG_MINUS_135, - 110.f, - -70.f + FLT_ANG_MINUS_135 + }; + + static const std::vector< float > possible_angles_freestanding = { + 0.f, + 45.f, + 90.f, + 135.f, + 180.f, }; bool dbg_resolver( ) { @@ -122,20 +126,20 @@ namespace features float dmg_right = get_damage( local_left, enemy_right, ent, g_ctx.m_local ) + get_damage( local_right, enemy_right, ent, g_ctx.m_local ); - if( std::abs( dmg_left - dmg_right ) < 50.f ) + if( std::abs( dmg_left - dmg_right ) < 25.f ) return false; float max_dmg = math::max( dmg_left, dmg_right ); ret_dir = dmg_left > dmg_right; cur_damage = max_dmg; - return max_dmg > 50.f; + return max_dmg > 25.f; }; float dist = ( ent->m_vecOrigin( ) - ent->get_hitbox_pos( 0 ) ).length2d( ); if( !test_dmg( dist + 1.f ) ) { - if( cur_damage < start_dmg * 2.f ) + if( cur_damage < start_dmg ) return -1; } @@ -159,51 +163,54 @@ namespace features reset( ); if( !( ent->m_fFlags( ) & FL_ONGROUND ) ) { - m_breaking = BREAKING_NONE; + m_state = R_NONE; return; } if( ent->get_anim_velocity( ).length2d( ) > 0.1f && !ent->is_fakewalking( ) ) { - m_breaking = BREAKING_NONE; + m_state = R_NONE; m_has_valid_lby = true; + m_last_moving_lby = ent->m_flLowerBodyYawTarget( ); return; } m_last_pos = ent->m_vecOrigin( ); m_was_invalid = false; - m_shots %= 100; - float lby = ent->m_flLowerBodyYawTarget( ); - if( lby != m_last_lby ) { - m_last_lby = lby; - m_last_update = ent->m_flSimulationTime( ); - m_breaking = BREAKING_NONE; + + int freestanding = g_cheat.m_ragebot.m_resolver->try_freestanding( ent ); + if( freestanding != -1 ) { + m_state = R_FREESTANDING; } + else + m_state = R_NORMAL; - if( ent->m_flSimulationTime( ) - m_last_update > TICK_INTERVAL( ) ) { - m_breaking = BREAKING; - } + if( m_last_freestanding != freestanding ) + m_angle_change = true; + m_last_freestanding = freestanding; m_has_valid_lby = true; } void c_ragebot::c_resolver::resolve_log_t::reset( ) { //assuming theyre STILL not moving this shouldnt change //however if they are, it will be reset to none anyway - m_breaking = BREAKING_NONE; + m_state = R_NONE; m_last_update = 0.f; m_last_lby = 0.f; m_missed_shots = 0; - m_shots = 0; - m_logged = false; - m_logged_shots = 0; + memset( m_shots, 0, sizeof( m_shots ) ); + memset( m_logged, 0, sizeof( m_logged ) ); + memset( m_logged_shots, 0, sizeof( m_logged ) ); } std::vector< float > c_ragebot::c_resolver::get_shot_vec( int ent ) { auto& data = m_data[ ent ]; - if( data.m_breaking ) - return possible_angles_adjust; + if( data.m_state == R_NORMAL ) + return possible_angles_normal; + if( data.m_state == R_FREESTANDING ) + return possible_angles_freestanding; return possible_angles_none; } @@ -212,12 +219,50 @@ namespace features auto& data = m_data[ ent_index ]; auto ent = g_csgo.m_entlist( )->GetClientEntity< >( ent_index ); - //if( data.m_logged && data.m_breaking ) { - // return data.m_logged_lby; - //} - auto vec = get_shot_vec( ent_index ); - return vec.at( shots % vec.size( ) ); + + float new_ang = vec.at( shots % vec.size( ) ); + float new_yaw = 0.f; + + float ang = math::vector_angles( ent->m_vecOrigin( ), g_ctx.m_last_origin ).y; + + if( data.m_state == R_FREESTANDING ) { + ang += ( data.m_last_freestanding == 1 ? 90.f : -90.f ); + + float sign = data.m_last_freestanding == 1 ? 1.f : -1.f; + + return ang + new_ang * sign; + } + + if( new_ang == FLT_ANG_LBY ) + new_yaw = ent->m_flLowerBodyYawTarget( ); + else if( new_ang == FLT_ANG_MOVING_LBY_UP ) { + if( !data.m_has_valid_lby && !g_settings.rage.pitch_resolver ) { + return get_shot_yaw( ++get_resolver_shots( ent_index ), ent_index ); + } + + auto delta = std::remainderf( data.m_last_moving_lby - data.m_last_lby, 360.f ); + bool breaking_lby = std::abs( delta ) > 35.f; + + new_yaw = breaking_lby ? data.m_last_moving_lby : data.m_last_lby; + } + else if( new_ang == FLT_ANG_180 ) { + new_yaw = ang - 180.f; + } + else if( new_ang == FLT_ANG_MINUS_90 ) { + new_yaw = ang - 90.f; + } + else if( new_ang == FLT_ANG_90 ) { + new_yaw = ang + 90.f; + } + else if( new_ang == FLT_ANG_135 ) + new_yaw = ang + 135.f; + else if( new_ang == FLT_ANG_MINUS_135 ) + new_yaw = ang - 135.f; + else + new_yaw = std::remainderf( ent->m_flLowerBodyYawTarget( ) + new_ang, 360.f ); + + return new_yaw; } void c_ragebot::c_resolver::aimbot( int ent_index, int hitbox, vec3_t angle, vec3_t position, vec3_t min, vec3_t max, float radius ) { @@ -233,7 +278,7 @@ namespace features return; } - if( !data.m_breaking ) { + if( !data.m_state ) { increment_shots( ent_index ); return; } @@ -252,7 +297,7 @@ namespace features new_shot.m_enemy_pos = position; new_shot.m_enemy_index = ent_index; new_shot.m_local_pos = g_ctx.m_local->get_eye_pos( ); - new_shot.m_resolver_shots = data.m_shots; + new_shot.m_resolver_shots = get_resolver_shots( ent_index ); new_shot.m_resolver_state = true; new_shot.m_hitbox.min = min; new_shot.m_hitbox.min = max; @@ -269,20 +314,21 @@ namespace features data.m_snapshot[ g_ctx.m_last_shot ] = data; - if( data.m_logged ) { - if( !--data.m_logged_shots ) { - data.m_logged = false; + if( data.m_logged[ data.m_state ] ) { + if( !--data.m_logged_shots[ data.m_state ] ) { + data.m_logged[ data.m_state ] = false; } } else { - int shots = data.m_shots; + int shots = get_resolver_shots( ent_index ); increment_shots( ent_index ); #if _DEBUG if( dbg_resolver( ) ) { char str[ 128 ]; - sprintf_s< 128 >( str, "[\3moneybot\1] incrementing shots from %d to %d", shots, data.m_shots ); + sprintf_s< 128 >( str, "[\3moneybot\1] incrementing shots from %d to %d" + "[\3moneybot\1] resolver state: %d\n", shots, get_resolver_shots( ent_index ), data.m_state ); g_csgo.m_clientmode( )->m_pChatElement->ChatPrintf( 0, 0, str ); } @@ -336,7 +382,7 @@ namespace features new_shot.m_enemy_pos = position; new_shot.m_enemy_index = ent_index; new_shot.m_local_pos = g_ctx.m_local->get_eye_pos( ); - new_shot.m_resolver_shots = data.m_shots; + new_shot.m_resolver_shots = get_resolver_shots( ent_index ); new_shot.m_resolver_state = true; new_shot.m_hitbox.min = min; new_shot.m_hitbox.min = max; @@ -350,26 +396,27 @@ namespace features g_ctx.m_has_incremented_shots = true; - if( data.m_logged ) { - if( !--data.m_logged_shots ) { - data.m_logged = false; + data.m_snapshot[ g_ctx.m_last_shot ] = data; + + if( data.m_logged[ data.m_state ] ) { + if( !--data.m_logged_shots[ data.m_state ] ) { + data.m_logged[ data.m_state ] = false; } } else { - int shots = data.m_shots; + int shots = get_resolver_shots( ent_index ); increment_shots( ent_index ); #if _DEBUG if( dbg_resolver( ) ) { char str[ 128 ]; - sprintf_s< 128 >( str, "[\3moneybot\1] incrementing shots from %d to %d", shots, data.m_shots ); + sprintf_s< 128 >( str, "[\3moneybot\1] incrementing shots from %d to %d" + "[\3moneybot\1] resolver state: %d\n", shots, get_resolver_shots( ent_index ), data.m_state ); g_csgo.m_clientmode( )->m_pChatElement->ChatPrintf( 0, 0, str ); } #endif } - - data.m_snapshot[ g_ctx.m_last_shot ] = data; } } } @@ -379,7 +426,7 @@ namespace features } void c_ragebot::c_resolver::increment_shots( int ent_index ) { - m_data[ ent_index ].m_shots++; + get_resolver_shots( ent_index )++; m_data[ ent_index ].m_missed_shots++; m_data[ ent_index ].m_angle_change = true; } @@ -391,11 +438,11 @@ namespace features auto& data = m_data[ ent_index ]; auto& snapshot = data.m_snapshot[ shots % 150 ]; - data.m_shots = snapshot.m_shots; + data.m_shots[ snapshot.m_state ] = snapshot.m_shots[ snapshot.m_state ]; - if( snapshot.m_logged ) { - data.m_logged = true; - data.m_logged_shots = snapshot.m_logged_shots; + if( snapshot.m_logged[ snapshot.m_state ] ) { + data.m_logged[ snapshot.m_state ] = true; + data.m_logged_shots[ snapshot.m_state ] = snapshot.m_logged_shots[ snapshot.m_state ]; } } @@ -416,17 +463,17 @@ namespace features auto rate = weapon->get_wpn_info( )->cycle_time; - data.m_shots = snapshot.m_shots; - data.m_logged = true; + data.m_shots[ snapshot.m_state ] = snapshot.m_shots[ snapshot.m_state ]; + data.m_logged[ snapshot.m_state ] = true; int latency_shots = ( nci->GetLatency( 0 ) + g_csgo.m_globals->m_frametime ) / rate + 1; - data.m_logged_shots = latency_shots; + data.m_logged_shots[ snapshot.m_state ] = latency_shots; #if _DEBUG if( dbg_resolver( ) ) { char str[ 128 ]; - sprintf_s< 128 >( str, "[\3moneybot\1] resolver: logging %d shots for %d with %d", data.m_logged_shots, ent_index, data.m_shots ); + sprintf_s< 128 >( str, "[\3moneybot\1] resolver: logging %d shots for %d with %d", data.m_logged_shots[ data.m_state ], ent_index, get_resolver_shots( ent_index ) ); g_csgo.m_clientmode( )->m_pChatElement->ChatPrintf( 0, 0, str ); } @@ -538,81 +585,13 @@ namespace features } int i = ent->ce( )->GetIndex( ); - auto& data = m_data[ i ]; - float start = ent->m_flLowerBodyYawTarget( ); - float new_yaw{ }; - float new_ang{ }; - int shots{ }; - - shots = data.m_shots; - new_ang = get_shot_yaw( shots, i ); - float ang; - if( g_ctx.run_frame( ) ) { - auto local_pos = g_ctx.m_local->m_vecOrigin( ); - auto enemy_pos = ent->m_vecOrigin( ); - - ang = math::vector_angles( enemy_pos, local_pos ).y; - } - else { - ang = start; - } - - float pitch = ent->m_angEyeAngles( ).x; - - if( g_settings.rage.pitch_resolver ) { - if( new_ang == FLT_ANG_MOVING_LBY_UP ) - ent->m_angEyeAngles( ).x = -89.f; - else - ent->m_angEyeAngles( ).x = 89.f; - } - - if( new_ang == FLT_ANG_LBY ) - new_yaw = ent->m_flLowerBodyYawTarget( ); - else if( new_ang == FLT_ANG_MOVING_LBY_UP ) { - if( !data.m_has_valid_lby && !g_settings.rage.pitch_resolver && ( ent->m_fFlags( ) & FL_ONGROUND ) ) { - data.m_shots++; - return brute_force( ent ); - } - - auto delta = std::remainderf( data.m_last_moving_lby - data.m_last_lby, 360.f ); - bool breaking_lby = std::abs( delta ) > 35.f; - - new_yaw = breaking_lby ? data.m_last_moving_lby : data.m_last_lby; - } - else if( new_ang == FLT_ANG_180 ) { - if( data.m_last_freestanding == -1 && ( ent->m_fFlags( ) & FL_ONGROUND ) ) { - data.m_shots++; - return brute_force( ent ); - } - - new_yaw = ang - 180.f; - } - else if( new_ang == FLT_ANG_FREESTANDING ) { - int freestanding = try_freestanding( ent ); - if( freestanding == -1 ) - new_yaw = ang + 180.f; - else - new_yaw = ang + ( freestanding ? 90.f : -90.f ); - - if( data.m_last_freestanding != freestanding ) - data.m_angle_change = true; + int s = get_resolver_shots( i ); + auto vec = get_shot_vec( i ); - data.m_last_freestanding = freestanding; - } - else if( new_ang == FLT_ANG_MINUS_90 ) { - new_yaw = ang - 90.f; - } - else if( new_ang == FLT_ANG_90 ) { - new_yaw = ang + 90.f; - } - else if( new_ang == FLT_ANG_135 ) - new_yaw = ang + 135.f; - else if( new_ang == FLT_ANG_MINUS_135 ) - new_yaw = ang - 135.f; - else - new_yaw = std::remainderf( start + new_ang, 360.f ); + if( vec.at( s % vec.size( ) ) == FLT_ANG_MOVING_LBY_UP && g_settings.rage.pitch_resolver ) + ent->m_angEyeAngles( ).x = -89.f; - new_yaw = std::remainderf( new_yaw, 360.f ); + float new_yaw = get_shot_yaw( get_resolver_shots( i ), i ); force_yaw( ent, new_yaw ); } diff --git a/internal_rewrite/visual_player.cpp b/internal_rewrite/visual_player.cpp index 8c824e9..e3917a6 100644 --- a/internal_rewrite/visual_player.cpp +++ b/internal_rewrite/visual_player.cpp @@ -294,7 +294,7 @@ namespace features if( ent->is_player( ) ) { if( g_settings.visuals.glow && - ent->is_valid( ) && ( ent->m_iTeamNum( ) != g_ctx.m_local->m_iTeamNum( ) || + ent->is_valid( ) && ent->has_valid_anim( ) && ( ent->m_iTeamNum( ) != g_ctx.m_local->m_iTeamNum( ) || g_settings.visuals.friendlies || g_settings.visuals.chams.friendlies ) ) { clr_t clr = ent->m_iTeamNum( ) == g_ctx.m_local->m_iTeamNum( ) ? @@ -530,7 +530,7 @@ namespace features right_pos += 9; } - if( !!g_cheat.m_ragebot.m_resolver->get_breaking_state( i ) && !dormant && g_ctx.m_local->is_valid( ) ) { + if( !!g_cheat.m_ragebot.m_resolver->get_state( i ) && !dormant && g_ctx.m_local->is_valid( ) ) { float update = g_cheat.m_ragebot.m_lagcomp->get_flick_time( i ); float delta = ( ent->m_flSimulationTime( ) - update ) * 0.9f; if( delta >= 0.f && delta <= 1.f ) { -- cgit v1.2.3