#endif
#ifdef SVQC
+
+bool Item_ItemsTime_Allow(entity e)
+{
+ GameItem it = e.itemdef;
+ return (false
+ || it.instanceOfPowerup
+ || it == ITEM_ArmorMega || it == ITEM_ArmorLarge
+ || it == ITEM_HealthMega || it == ITEM_HealthLarge
+ || (e.weapons & WEPSET_SUPERWEAPONS)
+ );
+}
+
float it_times[MAX_ITEMS];
void Item_ItemsTime_Init()
}
}
+bool Item_ItemsTime_Allow(entity e);
float Item_ItemsTime_UpdateTime(entity e, float t);
void Item_ItemsTime_SetTime(entity e, float t);
void Item_ItemsTime_SetTimesForAllPlayers();
sound (self, CH_TRIGGER, "misc/itemrespawn.wav", VOL_BASE, ATTEN_NORM); // play respawn sound
setorigin (self, self.origin);
- if(self.flags & FL_POWERUP || self.itemdef == ITEM_ArmorMega || self.items == IT_HEALTH || (self.weapons & WEPSET_SUPERWEAPONS))
+ if (Item_ItemsTime_Allow(self))
{
float t = Item_ItemsTime_UpdateTime(self, 0);
Item_ItemsTime_SetTime(self, t);
void Item_ScheduleRespawnIn(entity e, float t)
{
- if((e.flags & FL_POWERUP) || (e.weapons & WEPSET_SUPERWEAPONS) || e.itemdef == ITEM_ArmorMega || e.items == IT_HEALTH)
+ if (Item_ItemsTime_Allow(e))
{
e.think = Item_RespawnCountdown;
e.nextthink = time + max(0, t - ITEM_RESPAWN_TICKS);