From 3846e1b44d3c3739bda23918b413b90dc01b8da8 Mon Sep 17 00:00:00 2001 From: Juhu <5894800-Juhu_@users.noreply.gitlab.com> Date: Tue, 17 Jan 2023 23:37:31 +0100 Subject: [PATCH] Add patch from Juhu/strafehud-fixes branch: "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 9418b3cd5..07f7cf140 100644 --- a/qcsrc/client/hud/panel/strafehud.qc +++ b/qcsrc/client/hud/panel/strafehud.qc @@ -1171,7 +1171,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