]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Small optimization
authorterencehill <piuntn@gmail.com>
Tue, 19 Apr 2016 18:14:10 +0000 (20:14 +0200)
committerterencehill <piuntn@gmail.com>
Tue, 19 Apr 2016 18:14:10 +0000 (20:14 +0200)
qcsrc/client/hud/panel/weapons.qc

index 5af7cce487ea7965bdd33a1540704ebe7388f598..52fcc549aac908f7ee336b2bfaad6229a7d316a4 100644 (file)
@@ -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);