]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/items/inventory.qh
Undo last change of atten
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / items / inventory.qh
index a6d266ae5fba57d3d50727b25cb41d1fe1c396e2..ead573915e1ed8cbacb82af35286b8e67d681f4a 100644 (file)
@@ -14,6 +14,7 @@ class(Inventory) .int inv_items[Items_MAX];
 #ifdef CSQC
 void Inventory_Read(Inventory data)
 {
+    make_pure(self);
     const int bits = ReadInt24_t();
     FOREACH(Items, bits & BIT(it.m_id), LAMBDA(
         .int fld = inv_items[it.m_id];
@@ -44,7 +45,7 @@ bool Inventory_Send(entity this, entity to, int sf)
 {
     WriteByte(MSG_ENTITY, ENT_CLIENT_INVENTORY);
     entity e = self.owner;
-    if (IS_SPEC(e)) e = e.enemy;
+    if (/*IS_SPEC(e)*/ (e.classname == "spectator")) e = e.enemy;
     Inventory data = e.inventory;
     Inventory_Write(data);
     return true;
@@ -53,7 +54,7 @@ bool Inventory_Send(entity this, entity to, int sf)
 void Inventory_new(entity e)
 {
     Inventory inv = new(Inventory), bak = new(Inventory);
-    inv.classname = "inventory", bak.classname = "inventory";
+    make_pure(inv); make_pure(bak);
     inv.inventory = bak;
     inv.drawonlytoclient = e;
     Net_LinkEntity((inv.owner = e).inventory = inv, false, 0, Inventory_Send);