29 if (item.lifetime >= 0)
32 item.pickup_anyway =
true;
37 if (item.itemdef.instanceOfWeapon)
46 weapon_defaultspawnfunc(item, it);
49 FOREACH(Items, it.m_canonical_spawnfunc == item.classname,
54 LOG_FATALF(
"Invalid classname: %s", item.classname);
55 LABEL(classname_found)
62 if (item.lifetime > 0)
63 item.wait =
time + item.lifetime;
65 item.spawnfunc_checked =
true;
83 if(it.netname == item || (item ==
"random" && (it.spawnflags & WEP_FLAG_NORMAL) && !(it.spawnflags & WEP_FLAG_HIDDEN) && !(it.spawnflags & WEP_FLAG_SUPERWEAPON)))
84 RandomSelection_AddEnt(it, 1, 1);
88 if(it.netname == item || (item ==
"random" && (it.spawnflags &
ITEM_FLAG_NORMAL) && !it.instanceOfPowerup))
#define MUTATOR_CALLHOOK(id,...)
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
#define SPAWNFUNC_ITEM(name, item)
@ ITEM_FLAG_NORMAL
Item is usable during normal gameplay.
entity Item_RandomFromList(string itemlist)
Takes a space-separated list of netnames, returns the itemdef of one of them (or NULL if none are ava...
bool Item_Initialise(entity item)
An optimised and generic way to initialise items (loot or permanent)
bool Item_IsDefinitionAllowed(entity definition)
Checks whether the items with the specified definition are allowed to spawn.
Header file that describes the functions related to game items.
#define ITEM_SET_LOOT(item, loot)
Sets the item loot status.
#define FOREACH_WORD(words, cond, body)
#define FOREACH(list, cond, body)
ERASEABLE void RandomSelection_Init()
#define RandomSelection_AddEnt(e, weight, priority)
entity RandomSelection_chosen_ent
void StartItem(entity this, entity def)
void weapon_defaultspawnfunc(entity this, Weapon e)
const int WEP_FLAG_MUTATORBLOCKED
bool autocvar_sv_mapformat_is_quake3