From 3ace9684562a16a970d74495916e3ffb3b6043d3 Mon Sep 17 00:00:00 2001 From: Mario Date: Sun, 10 Jun 2018 21:32:54 +1000 Subject: [PATCH] Port the g_inventory global entity from the scoreboard items branch, for accessing the player's inventory locally --- qcsrc/common/items/inventory.qh | 2 ++ qcsrc/server/g_damage.qc | 1 + 2 files changed, 3 insertions(+) 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" -- 2.39.2