Xonotic
pickup.qc
Go to the documentation of this file.
1 #include "pickup.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  entity store = IS_PLAYER(player) ? PS(player) : player;
16  store.inventory.inv_items[this.m_id]++;
17  Inventory_update(store);
18  }
19  return b;
20 }
21 
22 #endif
entity() spawn
#define PS(this)
Definition: state.qh:18
Definition: pickup.qh:22
#define METHOD(cname, name, prototype)
Definition: oo.qh:257
int m_id
Definition: effect.qh:19
#define TC(T, sym)
Definition: _all.inc:82
#define ITEM_HANDLE(signal,...)
Definition: item.qh:103
bool Item_GiveTo(entity item, entity player)
Definition: items.qc:479
#define IS_PLAYER(v)
Definition: utils.qh:9