From: terencehill Date: Wed, 20 Apr 2016 17:25:47 +0000 (+0200) Subject: Fix weapons panel debug code X-Git-Tag: xonotic-v0.8.2~949^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=refs%2Fmerge-requests%2F313%2Fhead;p=xonotic%2Fxonotic-data.pk3dir.git Fix weapons panel debug code --- diff --git a/qcsrc/client/hud/panel/weapons.qc b/qcsrc/client/hud/panel/weapons.qc index 8fa22dd5e..cfacd59b6 100644 --- a/qcsrc/client/hud/panel/weapons.qc +++ b/qcsrc/client/hud/panel/weapons.qc @@ -120,10 +120,20 @@ void HUD_Weapons() /// debug code if(cvar("wep_add")) { + int j; + int nHidden = 0; + FOREACH(Weapons, it != WEP_Null, { + if (it.spawnflags & WEP_FLAG_MUTATORBLOCKED) nHidden += 1; + }); weapons_stat = '0 0 0'; - float countw = 1 + floor((floor(time * cvar("wep_add"))) % (Weapons_COUNT - 1)); - for(i = WEP_FIRST; i <= countw; ++i) - weapons_stat |= WepSet_FromWeapon(Weapons_from(i)); + float countw = 1 + floor((floor(time * cvar("wep_add"))) % ((Weapons_COUNT - 1) - nHidden)); + for(i = 0, j = 0; i <= (Weapons_COUNT - 1) && j < countw; ++i) + { + if(weaponorder[i].spawnflags & WEP_FLAG_MUTATORBLOCKED) + continue; + weapons_stat |= weaponorder[i].m_wepset; + ++j; + } } #endif }