From: terencehill Date: Tue, 19 Apr 2016 18:14:10 +0000 (+0200) Subject: Small optimization X-Git-Tag: xonotic-v0.8.2~949^2~2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=274e31155a8d146f2b8c990631c697642d73935c;p=xonotic%2Fxonotic-data.pk3dir.git Small optimization --- diff --git a/qcsrc/client/hud/panel/weapons.qc b/qcsrc/client/hud/panel/weapons.qc index 5af7cce48..52fcc549a 100644 --- a/qcsrc/client/hud/panel/weapons.qc +++ b/qcsrc/client/hud/panel/weapons.qc @@ -344,7 +344,6 @@ void HUD_Weapons() // retrieve information about the current weapon to be drawn entity it = weaponorder[i]; weapon_id = it.impulse; - isCurrent = (it == switchweapon); // skip if this weapon doesn't exist if(!it || weapon_id < 0) { continue; } @@ -367,6 +366,7 @@ void HUD_Weapons() noncurrent_pos.y = weapon_pos.y + (weapon_size.y - noncurrent_size.y) / 2; // draw background behind currently selected weapon + isCurrent = (it == switchweapon); if(isCurrent) drawpic_aspect_skin(weapon_pos, "weapon_current_bg", weapon_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);