]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
now CSQC _should_ be fine too
authorRudolf Polzer <divverent@alientrap.org>
Sun, 4 Mar 2012 17:47:46 +0000 (18:47 +0100)
committerRudolf Polzer <divverent@alientrap.org>
Sun, 4 Mar 2012 17:47:46 +0000 (18:47 +0100)
qcsrc/client/hud.qc
qcsrc/client/scoreboard.qc

index bf8785a49b360e99254308e837829f327f80940b..0223d07dfbf975f0e893bdd023f551b545ba5aa5 100644 (file)
@@ -432,7 +432,8 @@ float GetAmmoTypeForWep(float i)
 void HUD_Weapons(void)
 {
        // declarations
-       float weapons_stat = getstati(STAT_WEAPONS);
+       WEPSET_DECLARE_A(weapons_stat);
+       WEPSET_COPY_AS(weapons_stat);
        float i, f, a, j, factor;
        float screen_ar, center_x, center_y;
        float weapon_count, weapon_id, weapon_alpha;
@@ -519,9 +520,9 @@ void HUD_Weapons(void)
        {
                if(autocvar__hud_configure)
                {
-                       if (weapons_stat == 0) // create some fake weapons anyway
-                               for(i = 0; i <= WEP_LAST-WEP_FIRST; i += floor((WEP_LAST-WEP_FIRST)/5))
-                                       weapons_stat |= power2of(i);
+                       if (WEPSET_EMPTY_A(weapons_stat))
+                               for(i = WEP_FIRST; i <= WEP_LAST; i += floor((WEP_LAST-WEP_FIRST)/5))
+                                       WEPSET_OR_AW(weapons_stat, i);
 
                        if(menu_enabled != 2)
                                HUD_Panel_DrawBg(1); // also draw the bg of the entire panel
@@ -529,7 +530,7 @@ void HUD_Weapons(void)
 
                // do we own this weapon?
                for(i = 0; i <= WEP_LAST-WEP_FIRST; ++i)
-                       if(weapons_stat & weaponorder[i].weapons)
+                       if(WEPSET_CONTAINS_AW(weapons_stat, weaponorder[i].weapon))
                                ++weapon_count;
 
                // add it anyway if weaponcomplain is shown
@@ -678,7 +679,7 @@ void HUD_Weapons(void)
 
                // skip this weapon if we don't own it (and onlyowned is enabled)-- or if weapons_complainbubble is showing for this weapon
                if (autocvar_hud_panel_weapons_onlyowned
-                       && !((weapons_stat & self.weapons
+                       && !(WEPSET_CONTAINS_AW(weapons_stat, self.weapon
                        || (self.weapon == complain_weapon 
                                && time - complain_weapon_time < when + fadetime 
                                && autocvar_hud_panel_weapons_complainbubble)))
@@ -714,7 +715,7 @@ void HUD_Weapons(void)
                }
 
                // drawing all the weapon items
-               if(weapons_stat & self.weapons)
+               if(WEPSET_CONTAINS_AW(weapons_stat, self.weapon))
                {
                        // draw the weapon image
                        drawpic_aspect_skin(weapon_pos, strcat("weapon", self.netname), weapon_size, '1 1 1', weapon_alpha, DRAWFLAG_NORMAL);
index e828a17d57d888b5ec97f1f4a386f6aab2cc3d49..935a0277a85abdf98ce2f4d24bbbeb002eedf76e 100644 (file)
@@ -992,7 +992,7 @@ vector HUD_DrawScoreboardAccuracyStats(vector pos, vector rgb, vector bg_size)
        for(i = WEP_FIRST; i <= WEP_LAST; ++i)
        {
                self = get_weaponinfo(i);
-               if not(self.weapons)
+               if not(self.weapon)
                        continue;
                if ((i == WEP_NEX && g_minstagib) || i == WEP_PORTO || (i == WEP_MINSTANEX && !g_minstagib) || i == WEP_TUBA) // skip port-o-launch, nex || minstanex and tuba
                        continue;