From: Juhu <5894800-Juhu_@users.noreply.gitlab.com> Date: Wed, 1 Jul 2020 02:32:36 +0000 (+0200) Subject: strafehud: optimize by returning immediately in draw function if alpha or width is... X-Git-Tag: xonotic-v0.8.5~738^2~26 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=1a87686f92ad82d2398133ce252f423bb28aa017;p=xonotic%2Fxonotic-data.pk3dir.git strafehud: optimize by returning immediately in draw function if alpha or width is zero or less --- diff --git a/qcsrc/client/hud/panel/strafehud.qc b/qcsrc/client/hud/panel/strafehud.qc index cb9472061..bd41105c9 100644 --- a/qcsrc/client/hud/panel/strafehud.qc +++ b/qcsrc/client/hud/panel/strafehud.qc @@ -618,6 +618,8 @@ void HUD_Panel_DrawStrafeHUD(float offset, float width, vector color, float alph vector size = panel_size; vector mirror_size = panel_size; + if(alpha <= 0 || width <= 0) return; + if(offset < 0) { mirror_width = min(fabs(offset), width);