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
* 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;