]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix condition for splitting accuracy panel row in 2 (before it was split showing...
authorterencehill <piuntn@gmail.com>
Fri, 26 Aug 2016 23:46:25 +0000 (01:46 +0200)
committerterencehill <piuntn@gmail.com>
Fri, 26 Aug 2016 23:46:25 +0000 (01:46 +0200)
qcsrc/client/hud/panel/scoreboard.qc
qcsrc/client/hud/panel/weapons.qc

index a229719f6d1288a328eede9922f4e1ae4f8eaad3..ade7b982fd70e07d3ed50d3edb5f6ef7d5cbba8d 100644 (file)
@@ -1004,19 +1004,25 @@ vector Scoreboard_AccuracyStats_Draw(vector pos, vector rgb, vector bg_size)
        WepSet weapons_stat = WepSet_GetFromStat();
        WepSet weapons_inmap = WepSet_GetFromStat_InMap();
        int disownedcnt = 0;
+       int nHidden = 0;
        FOREACH(Weapons, it != WEP_Null, {
                int weapon_stats = weapon_accuracy[i - WEP_FIRST];
 
                WepSet set = it.m_wepset;
-               if (weapon_stats < 0 && !(weapons_stat & set || weapons_inmap & set))
-                       ++disownedcnt;
+               if (weapon_stats < 0)
+               {
+                       if (!(weapons_stat & set) && (it.spawnflags & WEP_FLAG_HIDDEN || it.spawnflags & WEP_FLAG_MUTATORBLOCKED))
+                               nHidden += 1;
+                       else if (!(weapons_stat & set || weapons_inmap & set))
+                               ++disownedcnt;
+               }
        });
 
-       int weapon_cnt = (Weapons_COUNT - 1) - disownedcnt;
+       int weapon_cnt = (Weapons_COUNT - 1) - disownedcnt - nHidden;
        if (weapon_cnt <= 0) return pos;
 
        int rows = 1;
-       if (autocvar_hud_panel_scoreboard_accuracy_doublerows && weapon_cnt >= floor((Weapons_COUNT - 1) * 0.5))
+       if (autocvar_hud_panel_scoreboard_accuracy_doublerows && weapon_cnt >= floor((Weapons_COUNT - nHidden - 1) * 0.5))
                rows = 2;
        int columnns = ceil(weapon_cnt / rows);
 
index 206bebc2f0cec146c9d0425112dfdea995a1729b..db25d532a016f938e31a04045ac54e1886f03617 100644 (file)
@@ -25,7 +25,7 @@ int weaponorder_cmp(int i, int j, entity pass)
        int nHidden = 0; \
        FOREACH(Weapons, it != WEP_Null, { \
                if (weapons_stat & WepSet_FromWeapon(it)) continue; \
-               if (it.spawnflags & WEP_FLAG_MUTATORBLOCKED) nHidden += 1; \
+               if (it.spawnflags & WEP_FLAG_HIDDEN || it.spawnflags & WEP_FLAG_MUTATORBLOCKED) nHidden += 1; \
        }); \
        vector table_size = HUD_GetTableSize_BestItemAR((Weapons_COUNT - 1) - nHidden, panel_size, aspect); \
        columns = table_size.x; \