X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fitems%2Finventory.qh;h=118b7079d0c832303ae7aa563172515fea190273;hb=2b84c25d7445eaef217edad2bbd22c3a616869b1;hp=6f6ebdc452a9f768b2626fc5aecf00e9f054876c;hpb=9e0107ad74a31422e209d4f97dbc4fdc9b669727;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/items/inventory.qh b/qcsrc/common/items/inventory.qh index 6f6ebdc45..118b7079d 100644 --- a/qcsrc/common/items/inventory.qh +++ b/qcsrc/common/items/inventory.qh @@ -154,9 +154,18 @@ void Inventory_new(PlayerState this) inv.owner = this; Net_LinkEntity(inv, false, 0, Inventory_Send); } + void Inventory_delete(entity e) { delete(e.inventory); } void Inventory_update(entity e) { e.inventory.SendFlags = 0xFFFFFF; } +void Inventory_pickupitem(Pickup this, entity player) +{ + //LOG_DEBUGF("entity %i picked up %s", player, this.m_name); + entity store = IS_PLAYER(player) ? PS(player) : player; + ++store.inventory.inv_items[this.m_id]; + Inventory_update(store); +} + void Inventory_clear(entity store) { // NOTE: you will need to perform Inventory_update after this to update the storage entity