From: Juhu <5894800-Juhu_@users.noreply.gitlab.com>
Date: Sun, 12 Jan 2025 14:49:05 +0000 (+0100)
Subject: strafehud: misc cosmetic code changes
X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a1c80770c33192e8d8a8aa36f688ac52b9920de0;p=xonotic%2Fxonotic-data.pk3dir.git

strafehud: misc cosmetic code changes
---

diff --git a/qcsrc/client/hud/panel/strafehud/draw.qc b/qcsrc/client/hud/panel/strafehud/draw.qc
index 9218b11676..51f92f8c96 100644
--- a/qcsrc/client/hud/panel/strafehud/draw.qc
+++ b/qcsrc/client/hud/panel/strafehud/draw.qc
@@ -244,7 +244,7 @@ void StrafeHUD_DrawSoftGradient(
 {
 	float alpha1 = bound(0, alpha, 1);
 	float alpha2 = bound(0, autocvar_hud_panel_strafehud_bar_neutral_alpha * panel_fg_alpha, 1);
-	if((alpha1 + alpha2) == 0) return;
+	if(alpha1 + alpha2 == 0) return;
 
 	float color_ratio = alpha1 / (alpha1 + alpha2);
 	vector segment_size = size;
@@ -329,6 +329,7 @@ void StrafeHUD_DrawTextIndicator(
 	drawstring_aspect(panel_pos + pos, text, size, color, alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
 }
 
+// checks whether the current style is a gradient style
 bool StrafeHUD_IsGradient(int style)
 {
 	return style == STRAFEHUD_STYLE_GRADIENT || style == STRAFEHUD_STYLE_SOFT_GRADIENT;
diff --git a/qcsrc/client/hud/panel/strafehud/extra.qc b/qcsrc/client/hud/panel/strafehud/extra.qc
index 0d12a035f6..e580395542 100644
--- a/qcsrc/client/hud/panel/strafehud/extra.qc
+++ b/qcsrc/client/hud/panel/strafehud/extra.qc
@@ -14,7 +14,7 @@
 
 // epsilon value for the slick detector steps to avoid
 // an infinite loop due to floating point rounding errors
-// (works with current limits as long as uncapped mode is not used)
+// (works with current limits)
 #define SLICKDETECT_STEPS_EPSILON 0.00001
 
 // slick detector
diff --git a/qcsrc/client/hud/panel/strafehud/util.qc b/qcsrc/client/hud/panel/strafehud/util.qc
index 7c18c01828..c3786e1a59 100644
--- a/qcsrc/client/hud/panel/strafehud/util.qc
+++ b/qcsrc/client/hud/panel/strafehud/util.qc
@@ -318,6 +318,7 @@ bool StrafeHUD_DetermineJumpHeld(entity e, int keys, bool is_local)
 }
 
 // mix two colors based on a ratio
+// TODO: move mixing colors out of the HUD, this could be useful for other code
 vector StrafeHUD_MixColors(vector color1, vector color2, float ratio)
 {
 	if(ratio <= 0) return color1;