27 error(
"Inventory_groups_minor is not a multiple of 8.");
30 error(sprintf(
"Inventory_groups_major can not be < %d.", min_major_value));
35#define G_MAJOR(id) (floor((id) / Inventory_groups_minor))
36#define G_MINOR(id) ((id) % Inventory_groups_minor)
57 if (!(majorBits &
BIT(i))) {
62 if (!(minorBits &
BIT(j))) {
66 .int fld = inv_items[it.
m_id];
67 int prev = this.(fld);
100 .int fld = inv_items[it.m_id];
101 const bool changed = store.(fld) != data.(fld);
102 store.(fld) = data.(fld);
105 majorBits =
BITSET(majorBits,
BIT(maj),
true);
113 if (!(majorBits &
BIT(i)))
120 if (!(minorBits &
BIT(j)))
153 this.inventory = inv;
165 ++store.inventory.inv_items[this.
m_id];
174 .int fld = inv_items[it.m_id];
#define BIT(n)
Only ever assign into the first 24 bits in QC (so max is BIT(23)).
#define BITSET(var, mask, flag)
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
int inv_items[REGISTRY_MAX(Items)]
Stores counts of items, the id being the index.
Purpose: common player state, usable on client and server Client: singleton representing the viewed p...
fields which are explicitly/manually set are marked with "M", fields set automatically are marked wit...
void Pickup_Update(entity item, int count)
void Inventory_update(entity e)
int minorBitsArr[Inventory_groups_major]
bool Inventory_Send(Inventory this, Client to, int sf)
Inventory inventory_store
Player inventory storage (holds previous state)
void InventoryStorage_attach(entity e)
void Inventory_remove(entity this)
const int Inventory_groups_minor
const int Inventory_groups_major
void Inventory_clear(entity store)
void Inventory_pickupitem(Pickup this, entity player)
void Inventory_new(PlayerState this)
Inventory inventory
Player inventory.
bool Inventory_customize(entity this, entity client)
void Inventory_delete(entity e)
void Inventory_Write(Inventory data, Inventory store)
void InventoryStorage_delete(entity e)
#define FOREACH(list, cond, body)
#define NET_HANDLE(id, param)
#define WriteHeader(to, id)
#define REGISTER_NET_LINKED(id)
void Net_LinkEntity(entity e, bool docull, float dt, bool(entity this, entity to, int sendflags) sendfunc)
#define ATTRIBARRAY(cname, name, type, cnt)
#define make_pure(e)
direct use is
#define REGISTRY_COUNT(id)
#define REGISTRY_GET(id, i)
#define STATIC_INIT(func)
during worldspawn