From e54ecda027c2176d9b8040a2784311d64984d547 Mon Sep 17 00:00:00 2001 From: Juhu <5894800-Juhu_@users.noreply.gitlab.com> Date: Tue, 23 Jun 2020 20:16:25 +0200 Subject: [PATCH] strafehud: make forward/backward detection work correctly with all kinds of strafing --- qcsrc/client/hud/panel/strafehud.qc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/qcsrc/client/hud/panel/strafehud.qc b/qcsrc/client/hud/panel/strafehud.qc index fdf636891..5e2f3ecfa 100644 --- a/qcsrc/client/hud/panel/strafehud.qc +++ b/qcsrc/client/hud/panel/strafehud.qc @@ -349,7 +349,7 @@ void HUD_StrafeHUD() } state_fwd_prev = state_fwd; - if((time - state_fwd_time) >= autocvar_hud_panel_strafehud_timeout_direction || speed < maxspeed) // timeout when changing between forwards and backwards movement + if((time - state_fwd_time) >= autocvar_hud_panel_strafehud_timeout_direction || speed < maxspeed || strafekeys) // timeout when changing between forwards and backwards movement { fwd = state_fwd; } @@ -568,8 +568,9 @@ void HUD_StrafeHUD() if(direction != 0) { bool indicator_direction = direction < 0; - // invert left/right if strafing backwards - if(fwd == false) + // invert left/right when strafing backwards or when strafing towards the opposite side indicated by the direction variable + // if both conditions are true then it's inverted twice hence not inverted at all + if(!fwd != odd_angles) { indicator_direction = !indicator_direction; } -- 2.39.2