From: Rudolf Polzer Date: Wed, 23 Jun 2010 13:07:02 +0000 (+0200) Subject: fix weapon count when sorting X-Git-Tag: xonotic-v0.1.0preview~529 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=10aec6f69e4e2a6d100cdc8f4b47ec419bf628dd fix weapon count when sorting --- diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index b457667e3e..1b8b2366e0 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -1431,6 +1431,7 @@ void HUD_WeaponIcons(void) mySize = HUD_Panel_GetSize(id); stat_weapons = getstati(STAT_WEAPONS); + weapon_cnt = 0; for(i = WEP_FIRST; i <= WEP_LAST; ++i) { self = get_weaponinfo(i); @@ -1446,11 +1447,15 @@ void HUD_WeaponIcons(void) if(weaponorder_cmp_str_save) strunzone(weaponorder_cmp_str_save); weaponorder_cmp_str_save = strzone(weaponorder_cmp_str); + weapon_cnt = 0; for(i = WEP_FIRST; i <= WEP_LAST; ++i) { self = get_weaponinfo(i); if(self.impulse >= 0) + { weaponorder[weapon_cnt] = self; + ++weapon_cnt; + } } heapsort(weapon_cnt, weaponorder_swap, weaponorder_cmp, world); }