From 79db4a54a79ae2a7b06bf79410403fb16c3feb70 Mon Sep 17 00:00:00 2001 From: otta8634 Date: Wed, 18 Sep 2024 03:19:31 +0800 Subject: [PATCH] Apply more restrictions to W-turn angle rendering Formula is only valid when sv_aircontrol_power == 2 ... and sv_aircontrol_penalty == 0 It's too difficult for me to figure out the formula if otherwise --- qcsrc/client/hud/panel/strafehud.qc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/qcsrc/client/hud/panel/strafehud.qc b/qcsrc/client/hud/panel/strafehud.qc index 880e28034..f40d3f593 100644 --- a/qcsrc/client/hud/panel/strafehud.qc +++ b/qcsrc/client/hud/panel/strafehud.qc @@ -142,6 +142,7 @@ void HUD_StrafeHUD() float maxaccel = !autocvar__hud_configure ? maxaccel_phys : 1; float airstopaccel = PHYS_AIRSTOPACCELERATE(strafeplayer); float aircontrol = PHYS_AIRCONTROL(strafeplayer); + bool aircontrol_formula_valid = PHYS_AIRCONTROL_PENALTY(strafeplayer) == 0 && PHYS_AIRCONTROL_POWER(strafeplayer) == 2; bool aircontrol_backwards = PHYS_AIRCONTROL_BACKWARDS(strafeplayer) == 1; bool airaccel_qw = PHYS_AIRACCEL_QW(strafeplayer) == 1; // change the range from 0° - 360° to -180° - 180° to match how view_angle represents angles @@ -661,7 +662,8 @@ void HUD_StrafeHUD() * this is only enabled if sv_airaccel_qw == 1 since otherwise W-turning gives acceleration, unless hud_panel_strafehud_wturn_unrestricted == 1 */ bool wturning = !onground && wishangle == 0 && (keys_fwd == STRAFEHUD_KEYS_FORWARD || (aircontrol_backwards && keys_fwd == STRAFEHUD_KEYS_BACKWARD)); - bool wturn_check = autocvar_hud_panel_strafehud_wturn && !immobile && aircontrol && (autocvar_hud_panel_strafehud_wturn_unrestricted == 1 || airaccel_qw); + bool wturn_valid = aircontrol && aircontrol_formula_valid && (airaccel_qw || autocvar_hud_panel_strafehud_wturn_unrestricted == 1); + bool wturn_check = autocvar_hud_panel_strafehud_wturn && !immobile && wturn_valid; if(wturn_check) { float wturn_a = 32 * aircontrol * dt; -- 2.39.2