From 25de4c18ba065b1af3e54e1923a04d396d7b9494 Mon Sep 17 00:00:00 2001 From: Juhu <5894800-Juhu_@users.noreply.gitlab.com> Date: Tue, 17 Jan 2023 23:35:20 +0100 Subject: [PATCH] strafehud: don't draw text indicators if fade time is zero, not even for one frame --- qcsrc/client/hud/panel/strafehud.qc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qcsrc/client/hud/panel/strafehud.qc b/qcsrc/client/hud/panel/strafehud.qc index 514cb5c2e..e12e17a18 100644 --- a/qcsrc/client/hud/panel/strafehud.qc +++ b/qcsrc/client/hud/panel/strafehud.qc @@ -1103,7 +1103,7 @@ void StrafeHUD_drawStrafeArrow(vector origin, float size, vector color, float al // draw a fading text indicator above or below the strafe meter, return true if something was displayed bool StrafeHUD_drawTextIndicator(string text, float height, vector color, float fadetime, float lasttime, float offset, int position) { - if((height <= 0) || (lasttime <= 0) || ((time - lasttime) >= fadetime)) + if((height <= 0) || (lasttime <= 0) || (fadetime <= 0) || ((time - lasttime) >= fadetime)) return false; float alpha = cos(((time - lasttime) / fadetime) * 90 * DEG2RAD); // fade non-linear like the physics panel does -- 2.39.2