From: terencehill Date: Sun, 29 Nov 2020 11:47:01 +0000 (+0100) Subject: Item stats: implement the item filter as a whitelist; also add a note as to why we... X-Git-Tag: xonotic-v0.8.5~588^2~11 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=0e19497374dac79f15f85693c09ad3bd7b2dea1f;p=xonotic%2Fxonotic-data.pk3dir.git Item stats: implement the item filter as a whitelist; also add a note as to why we need a copy of the Items registry --- diff --git a/qcsrc/client/hud/panel/scoreboard.qc b/qcsrc/client/hud/panel/scoreboard.qc index c0f1bc6ea..a9f1a67bc 100644 --- a/qcsrc/client/hud/panel/scoreboard.qc +++ b/qcsrc/client/hud/panel/scoreboard.qc @@ -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; } }); } diff --git a/qcsrc/common/items/all.qh b/qcsrc/common/items/all.qh index 7134a9947..bb2e387fb 100644 --- a/qcsrc/common/items/all.qh +++ b/qcsrc/common/items/all.qh @@ -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) {