float wishangle = StrafeHUD_DetermineWishAngle(movement, keys, islocal);
bool strafekeys = fabs(wishangle) > 45;
- // determine minimum required angle to display full strafe range
- float range_minangle = fabs(wishangle) % 90; // maximum range is 90 degree
- if(range_minangle > 45) range_minangle = 45 - fabs(wishangle) % 45; // minimum angle range is 45
- range_minangle = 90 - range_minangle; // calculate value which is never >90 or <45
- range_minangle *= 2; // multiply to accommodate for both sides of the hud
-
- float hudangle = StrafeHUD_DetermineHudAngle(range_minangle);
+ float hudangle = StrafeHUD_DetermineHudAngle(wishangle);
// detect air strafe turning
static bool turn = false;
return wishangle;
}
-float StrafeHUD_DetermineHudAngle(float range_minangle)
+float StrafeHUD_DetermineHudAngle(float wishangle)
{
float hudangle;
if(isnan(autocvar_hud_panel_strafehud_range))
else if(autocvar_hud_panel_strafehud_range == 0)
{
if(autocvar__hud_configure)
+ {
hudangle = 90;
+ }
else
+ {
+ // determine minimum required angle to display full strafe range
+ float range_minangle = fabs(wishangle) % 90; // maximum range is 90 degree
+ if(range_minangle > 45) range_minangle = 45 - fabs(wishangle) % 45; // minimum angle range is 45
+ range_minangle = 90 - range_minangle; // calculate value which is never >90 or <45
+ range_minangle *= 2; // multiply to accommodate for both sides of the hud
+
hudangle = range_minangle; // use minimum angle required if dynamically setting hud angle
+ }
}
else if(autocvar_hud_panel_strafehud_range < 0)
{