From 1a87686f92ad82d2398133ce252f423bb28aa017 Mon Sep 17 00:00:00 2001 From: Juhu <5894800-Juhu_@users.noreply.gitlab.com> Date: Wed, 1 Jul 2020 04:32:36 +0200 Subject: [PATCH] strafehud: optimize by returning immediately in draw function if alpha or width is zero or less --- qcsrc/client/hud/panel/strafehud.qc | 2 ++ 1 file changed, 2 insertions(+) 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); -- 2.39.2