From: Mario Date: Sun, 18 Oct 2020 23:55:38 +0000 (+1000) Subject: Merge branch 'master' into terencehill/scoreboard_item_stats X-Git-Tag: xonotic-v0.8.5~588^2~22 X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=873f1b3ef177d3b290982be4adb3707482b8c6fc Merge branch 'master' into terencehill/scoreboard_item_stats --- 873f1b3ef177d3b290982be4adb3707482b8c6fc diff --cc qcsrc/client/hud/panel/scoreboard.qc index 51c7a14c35,7f3c8e5c28..c474ad33b8 --- a/qcsrc/client/hud/panel/scoreboard.qc +++ b/qcsrc/client/hud/panel/scoreboard.qc @@@ -1894,9 -1815,9 +1917,10 @@@ void Scoreboard_Draw( if (Scoreboard_AccuracyStats_WouldDraw(pos.y)) pos = Scoreboard_AccuracyStats_Draw(pos, panel_bg_color, bg_size); + pos = Scoreboard_ItemStats_Draw(pos, panel_bg_color, bg_size); - if(ISGAMETYPE(CTS) || ISGAMETYPE(RACE) || (autocvar_hud_panel_scoreboard_ctf_leaderboard && ISGAMETYPE(CTF) && STAT(CTF_SHOWLEADERBOARD))) { + if(MUTATOR_CALLHOOK(ShowRankings)) { + string ranktitle = M_ARGV(0, string); if(race_speedaward) { drawcolorcodedstring(pos, sprintf(_("Speed award: %d%s ^7(%s^7)"), race_speedaward, race_speedaward_unit, ColorTranslateRGB(race_speedaward_holder)), hud_fontsize, panel_fg_alpha, DRAWFLAG_NORMAL); pos.y += 1.25 * hud_fontsize.y; diff --cc qcsrc/common/items/inventory.qh index ed6c7355d2,c47be66997..cc17571ecc --- a/qcsrc/common/items/inventory.qh +++ b/qcsrc/common/items/inventory.qh @@@ -5,9 -5,7 +5,7 @@@ #ifdef GAMEQC CLASS(Inventory, Object) /** Stores counts of items, the id being the index */ - ATTRIBARRAY(Inventory, inv_items, int, REGISTRY_MAX(Items)); + ATTRIBARRAY(Inventory, inv_items, int, Items_MAX); - /** Previous state */ - ATTRIB(Inventory, inventory, Inventory); ENDCLASS(Inventory) /** Player inventory */ @@@ -119,6 -133,9 +119,9 @@@ void Inventory_new(PlayerState this setcefc(inv, Inventory_customize); Net_LinkEntity((inv.owner = this).inventory = inv, false, 0, Inventory_Send); } --void Inventory_delete(entity e) { delete(e.inventory.inventory); delete(e.inventory); } ++void Inventory_delete(entity e) { delete(e.inventory); } void Inventory_update(entity e) { e.inventory.SendFlags = 0xFFFFFF; } + + void InventoryStorage_attach(entity e) { e.inventory_store = NEW(Inventory); e.inventory_store.drawonlytoclient = e; } + void InventoryStorage_detach(entity e) { delete(e.inventory_store); } #endif