Xonotic
pickup.qc
Go to the documentation of this file.
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
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
entity() spawn
PS
#define PS(this)
Definition:
state.qh:18
Pickup
Definition:
pickup.qh:22
METHOD
#define METHOD(cname, name, prototype)
Definition:
oo.qh:257
inventory.qh
m_id
int m_id
Definition:
effect.qh:19
TC
#define TC(T, sym)
Definition:
_all.inc:82
ITEM_HANDLE
#define ITEM_HANDLE(signal,...)
Definition:
item.qh:103
Item_GiveTo
bool Item_GiveTo(entity item, entity player)
Definition:
items.qc:479
pickup.qh
IS_PLAYER
#define IS_PLAYER(v)
Definition:
utils.qh:9
common
items
item
pickup.qc
Generated on Thu Mar 17 2022 17:26:27 for Xonotic by
1.8.13