From: Juhu <5894800-Juhu_@users.noreply.gitlab.com> Date: Tue, 17 Jan 2023 22:37:31 +0000 (+0100) Subject: Add patch from Juhu/strafehud-fixes branch: "strafehud: don't draw text indicators... X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=3846e1b44d3c3739bda23918b413b90dc01b8da8;p=xonotic%2Fxonotic-data.pk3dir.git Add patch from Juhu/strafehud-fixes branch: "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 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