summaryrefslogtreecommitdiff
path: root/cheat/internal_rewrite/movement.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cheat/internal_rewrite/movement.cpp')
-rw-r--r--cheat/internal_rewrite/movement.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/cheat/internal_rewrite/movement.cpp b/cheat/internal_rewrite/movement.cpp
index 3793e1b..0097027 100644
--- a/cheat/internal_rewrite/movement.cpp
+++ b/cheat/internal_rewrite/movement.cpp
@@ -61,13 +61,13 @@ void c_movement::auto_strafer( ) {
if( !cmd->m_mousedx ) {
float ideal_rotation = std::min( RAD2DEG( std::asinf( 30.f / std::max( speed, FLT_EPSILON ) ) ) * 0.5f, 45.f );
- if( ( cmd->m_cmd_nr % 2 ) )
- ideal_rotation *= -1;
+ float sign = cmd->m_cmd_nr % 2 ? 1.f : -1.f;
- cmd->m_sidemove = ( cmd->m_cmd_nr % 2 ) ? 450.f : -450.f;
- cmd->m_forwardmove = 0;
- rotate_movement( cmd, ideal_rotation );
+ cmd->m_sidemove = 0.f;
+ cmd->m_forwardmove = 450.f;
+
+ rotate_movement( cmd, ( ideal_rotation - 90.f ) * sign );
}
else {
cmd->m_sidemove = m_ucmd->m_mousedx < 0.f ? -450.f : 450.f;