From: TimePath Date: Mon, 5 Oct 2015 08:10:52 +0000 (+1100) Subject: Weapons: Don't take mutator blocked weapons into account when sizing the weapons... X-Git-Tag: xonotic-v0.8.2~1874^2~9 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=47c5ad63c15209759ad4922fd31d2b51d0e510e4 Weapons: Don't take mutator blocked weapons into account when sizing the weapons panel, unless they are held --- diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index 1b762f82d0..a47ccd7a0f 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -472,7 +472,15 @@ void HUD_Weapons(void) vector padded_panel_size = panel_size - '2 2 0' * panel_bg_padding; // get the all-weapons layout - vector table_size = HUD_GetTableSize_BestItemAR((WEP_COUNT - 1), padded_panel_size, aspect); + int nHidden = 0; + WepSet weapons_stat = WepSet_GetFromStat(); + for (int i = WEP_FIRST; i <= WEP_LAST; ++i) { + WepSet weapons_wep = WepSet_FromWeapon(i); + if (weapons_stat & weapons_wep) continue; + Weapon w = get_weaponinfo(i); + if (w.spawnflags & WEP_FLAG_MUTATORBLOCKED) nHidden += 1; + } + vector table_size = HUD_GetTableSize_BestItemAR((WEP_COUNT - 1) - nHidden, padded_panel_size, aspect); columns = table_size.x; rows = table_size.y; weapon_size.x = padded_panel_size.x / columns;