if(def.m_iteminit)
def.m_iteminit(def, this);
- if(!this.respawntime) // both need to be set
- {
- this.respawntime = defaultrespawntime;
- this.respawntimejitter = defaultrespawntimejitter;
- }
-
if(!this.pickup_anyway && def.m_pickupanyway)
this.pickup_anyway = def.m_pickupanyway();
}
else
{
+ // must be done after def.m_iteminit() as that may set ITEM_FLAG_MUTATORBLOCKED
if(!have_pickup_item(this))
{
startitem_failed = true;
return;
}
+ // must be done before Item_Reset() and after MUTATORBLOCKED check (blocked items may have null func ptrs)
+ if(!this.respawntime) // both need to be set
+ {
+ this.respawntime = defaultrespawntime ? defaultrespawntime : def.m_respawntime();
+ this.respawntimejitter = defaultrespawntimejitter ? defaultrespawntimejitter : def.m_respawntimejitter();
+ }
+
if(this.angles != '0 0 0')
this.SendFlags |= ISF_ANGLES;
_StartItem(
this,
this.itemdef = def,
- def.m_respawntime(), // defaultrespawntime
- def.m_respawntimejitter() // defaultrespawntimejitter
+ 0, // call def.m_respawntime() to get defaultrespawntime
+ 0 // call def.m_respawntimejitter() to get defaultrespawntimejitter
);
}
float autocvar_sv_simple_items;
bool ItemSend(entity this, entity to, int sf);
-bool have_pickup_item(entity this);
-
const float ITEM_RESPAWN_TICKS = 10;
// string overrides entity