From b1cd9458f103d99f4de1807f512ed9ffd2e38220 Mon Sep 17 00:00:00 2001 From: navewindre Date: Wed, 19 Sep 2018 21:51:56 +0200 Subject: dsad --- internal_rewrite/movement.cpp | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'internal_rewrite/movement.cpp') diff --git a/internal_rewrite/movement.cpp b/internal_rewrite/movement.cpp index e62dfda..8760487 100644 --- a/internal_rewrite/movement.cpp +++ b/internal_rewrite/movement.cpp @@ -14,13 +14,7 @@ float get_ideal_strafe_step( float speed ) { static auto* sv_airaccelerate = g_csgo.m_cvar( )->FindVar( xors( "sv_airaccelerate" ) ); float airaccel = std::min< float >( sv_airaccelerate->get_float( ), 30.f ); - float step = std::atan2( airaccel, speed ) * M_RADPI; - - //tickcount correction - float tickcount = 1.0f / g_csgo.m_globals->m_interval_per_tick; - step *= ( 64.f / tickcount ); - - return step; + return RAD2DEG( std::asinf( 30.f / speed ) ) * 0.5f; } void rotate_movement( user_cmd_t* cmd, float rotation ) { @@ -62,13 +56,8 @@ void c_movement::auto_strafer( ) { if( cmd && ( m_ucmd->m_buttons & IN_JUMP ) && ( speed > 1.0f || g_settings.misc.air_duck( ) ) && !on_ground ) { if( !cmd->m_forwardmove && !cmd->m_sidemove ) { if( !cmd->m_mousedx ) { - vec3_t velocity_dir = math::vector_angles( vec3_t( ), velocity ); - float yaw = g_csgo.m_engine( )->GetViewAngles( ).y; - - static auto* sv_airaccelerate = g_csgo.m_cvar( )->FindVar( xors( "sv_airaccelerate" ) ); - float airaccel = std::min< float >( sv_airaccelerate->get_float( ), 30.f ); + float ideal_rotation = std::min( RAD2DEG( std::asinf( 30.f / std::max( speed, FLT_EPSILON ) ) ) * 0.5f, 45.f ); - float ideal_rotation = std::clamp( RAD2DEG( std::atan2f( airaccel, speed ) ), 0.f, 45.f ); if( ( cmd->m_cmd_nr % 2 ) ) ideal_rotation *= -1; -- cgit v1.2.3