]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/items/inventory.qh
Item Pickup panel
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / items / inventory.qh
index 22a4d94c387335f833d0867f2acb1df01e776663..6f6ebdc452a9f768b2626fc5aecf00e9f054876c 100644 (file)
@@ -37,7 +37,10 @@ STATIC_INIT(Inventory)
 #endif
 
 #ifdef CSQC
+#include <client/hud/panel/pickup.qh>
+
 Inventory g_inventory;
+
 void Inventory_remove(entity this)
 {
     if(g_inventory == this)
@@ -63,11 +66,20 @@ NET_HANDLE(ENT_CLIENT_INVENTORY, bool isnew)
             .int fld = inv_items[it.m_id];
             int prev = this.(fld);
             int next = this.(fld) = ReadByte();
+
+            Pickup_Update(it, next - prev);
             LOG_DEBUGF("%s: %.0f -> %.0f", it.m_name, prev, next);
         }
     }
     return true;
 }
+
+NET_HANDLE(TE_CSQC_WEAPONPICKUP, bool isnew)
+{
+       const Weapon it = REGISTRY_GET(Weapons, ReadByte());
+       Pickup_Update(it, 1);
+       return true;
+}
 #endif
 
 #ifdef SVQC