]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/items/item/pickup.qc
Merge branch 'master' into Mario/stats_eloranking
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / items / item / pickup.qc
1 #include "pickup.qh"
2 #include <common/items/inventory.qh>
3
4 #ifdef SVQC
5 bool ITEM_HANDLE(Pickup, entity this, entity item, entity player) {
6     return this.giveTo(this, item, player);
7 }
8
9 METHOD(Pickup, giveTo, bool(Pickup this, entity item, entity player))
10 {
11     TC(Pickup, this);
12     bool b = Item_GiveTo(item, player);
13     if (b) {
14         LOG_DEBUGF("entity %i picked up %s", player, this.m_name);
15         player.inventory.inv_items[this.m_id]++;
16         Inventory_update(player);
17     }
18     return b;
19 }
20
21 #endif