]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Item stats: implement the item filter as a whitelist; also add a note as to why we...
authorterencehill <piuntn@gmail.com>
Sun, 29 Nov 2020 11:47:01 +0000 (12:47 +0100)
committerterencehill <piuntn@gmail.com>
Sun, 29 Nov 2020 14:46:56 +0000 (15:46 +0100)
qcsrc/client/hud/panel/scoreboard.qc
qcsrc/common/items/all.qh

index c0f1bc6eac8ff2b046adc90f147767d9ce57daa4..a9f1a67bc37a2c225881ee780499eb46e5a01236 100644 (file)
@@ -1323,20 +1323,12 @@ vector Scoreboard_AccuracyStats_Draw(vector pos, vector rgb, vector bg_size)
 STATIC_INIT(default_order_items_label)
 {
        IL_EACH(default_order_items, true, {
-               switch(it.netname)
+               if(!(it.instanceOfPowerup
+                       || it == ITEM_HealthMega || it == ITEM_HealthBig
+                       || it == ITEM_ArmorMega || it == ITEM_ArmorBig
+                       ))
                {
-                       case "bullets":
-                       case "cells":
-                       case "plasma":
-                       case "rockets":
-                       case "shells":
-                       case "vaporizer_cells":
-                       case "fuel":
-                       case "armor_small":
-                       case "armor_medium":
-                       case "health_small":
-                       case "health_medium":
-                               it.uninteresting = true;
+                       it.uninteresting = true;
                }
        });
 }
index 7134a9947b674aa1d2b6573ba598d9bfd969bef7..bb2e387fb9cd7df3dad696d3401f06ea77e7aadb 100644 (file)
@@ -13,6 +13,8 @@ REGISTER_REGISTRY(Items)
 #define REGISTER_ITEM(id, class) REGISTER(Items, ITEM, id, m_id, NEW(class))
 
 #ifdef CSQC
+// Copy Items registry here before it gets sorted alphabetically by REGISTRY_SORT
+// so we can keep items sorted by categories (as they appear in the code)
 IntrusiveList default_order_items;
 STATIC_INIT(default_order_items)
 {