From: TimePath Date: Mon, 24 Aug 2015 03:56:05 +0000 (+1000) Subject: Show 50 armor and health in itemstime. Fixes #1521 X-Git-Tag: xonotic-v0.8.2~2042^2~1 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=05bba0fbdbc13bda89061dfdf46ab3b48b62b265;p=xonotic%2Fxonotic-data.pk3dir.git Show 50 armor and health in itemstime. Fixes #1521 --- diff --git a/qcsrc/common/mutators/mutator/itemstime.qc b/qcsrc/common/mutators/mutator/itemstime.qc index fe29496ba..f0db281af 100644 --- a/qcsrc/common/mutators/mutator/itemstime.qc +++ b/qcsrc/common/mutators/mutator/itemstime.qc @@ -25,6 +25,18 @@ MUTATOR_HOOKFUNCTION(itemstime, CSQC_Parse_TempEntity) { #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() diff --git a/qcsrc/server/t_items.qc b/qcsrc/server/t_items.qc index 747075812..406f8ec33 100644 --- a/qcsrc/server/t_items.qc +++ b/qcsrc/server/t_items.qc @@ -412,6 +412,7 @@ void Item_Think() } } +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(); @@ -428,7 +429,7 @@ void Item_Respawn (void) 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); @@ -539,7 +540,7 @@ void Item_RespawnThink() 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);