From: Juhu <5894800-Juhu_@users.noreply.gitlab.com> Date: Tue, 17 Jan 2023 22:35:20 +0000 (+0100) Subject: strafehud: don't draw text indicators if fade time is zero, not even for one frame X-Git-Tag: xonotic-v0.8.6~136^2~6 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=25de4c18ba065b1af3e54e1923a04d396d7b9494;p=xonotic%2Fxonotic-data.pk3dir.git strafehud: don't draw text indicators if fade time is zero, not even for one frame --- 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