From: Mario Date: Sun, 10 Jun 2018 11:32:54 +0000 (+1000) Subject: Port the g_inventory global entity from the scoreboard items branch, for accessing... X-Git-Tag: xonotic-v0.8.5~2080 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=3ace9684562a16a970d74495916e3ffb3b6043d3;p=xonotic%2Fxonotic-data.pk3dir.git Port the g_inventory global entity from the scoreboard items branch, for accessing the player's inventory locally --- diff --git a/qcsrc/common/items/inventory.qh b/qcsrc/common/items/inventory.qh index 852007501..9075c0912 100644 --- a/qcsrc/common/items/inventory.qh +++ b/qcsrc/common/items/inventory.qh @@ -21,9 +21,11 @@ const int Inventory_groups_minor = 8; // ceil(Items_MAX / Inventory_groups_major #define G_MINOR(id) ((id) % Inventory_groups_minor) #ifdef CSQC +Inventory g_inventory; NET_HANDLE(ENT_CLIENT_INVENTORY, bool isnew) { make_pure(this); + g_inventory = this; const int majorBits = ReadShort(); for (int i = 0; i < Inventory_groups_major; ++i) { if (!(majorBits & BIT(i))) { diff --git a/qcsrc/server/g_damage.qc b/qcsrc/server/g_damage.qc index e49640490..21c00738f 100644 --- a/qcsrc/server/g_damage.qc +++ b/qcsrc/server/g_damage.qc @@ -24,6 +24,7 @@ #include "../common/playerstats.qh" #include "../common/teams.qh" #include "../common/util.qh" +#include #include #include "../lib/csqcmodel/sv_model.qh" #include "../lib/warpzone/common.qh"