diff options
| author | navewindre <boneyaard@gmail.com> | 2018-12-04 19:56:23 +0100 |
|---|---|---|
| committer | navewindre <boneyaard@gmail.com> | 2018-12-04 19:56:23 +0100 |
| commit | 009f264c3d98f742bec9aaeaafe86d66ad5116a5 (patch) | |
| tree | 0f928ae839867e117a694cd84c2dcfcf419d330b /cheat/internal_rewrite/movement.cpp | |
| parent | a7e0ce1fb433a3f1ba34b92b084a2c5e8baf4dfe (diff) | |
dadffsad
Diffstat (limited to 'cheat/internal_rewrite/movement.cpp')
| -rw-r--r-- | cheat/internal_rewrite/movement.cpp | 10 |
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;
|
