]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/items/item/pickup.qc
Merge branch 'master' into terencehill/bot_waypoints
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / items / item / pickup.qc
index 35aac2bff729080e975238591f69bcda09fae716..b5944fc0a3def7d7235f09bfc66e6ad33f2fb11e 100644 (file)
@@ -1,13 +1,21 @@
 #include "pickup.qh"
+#include <common/items/inventory.qh>
 
 #ifdef SVQC
 bool ITEM_HANDLE(Pickup, entity this, entity item, entity player) {
-    bool b = this.giveTo(this, item, player);
+    return this.giveTo(this, item, player);
+}
+
+METHOD(Pickup, giveTo, bool(Pickup this, entity item, entity player))
+{
+    TC(Pickup, this);
+    bool b = Item_GiveTo(item, player);
     if (b) {
-        dprintf("entity %i picked up %s\n", player, this.m_name);
+        LOG_DEBUGF("entity %i picked up %s", player, this.m_name);
         player.inventory.inv_items[this.m_id]++;
         Inventory_update(player);
     }
     return b;
 }
+
 #endif