From: TimePath Date: Tue, 25 Aug 2015 00:48:47 +0000 (+1000) Subject: Use the reset_map_global hook X-Git-Tag: xonotic-v0.8.2~2028^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8262fbc8644f600676875a7c2d1bd03bdc0adb6c;p=xonotic%2Fxonotic-data.pk3dir.git Use the reset_map_global hook --- diff --git a/qcsrc/common/mutators/mutator/itemstime.qc b/qcsrc/common/mutators/mutator/itemstime.qc index ca65c2c48..ee571790a 100644 --- a/qcsrc/common/mutators/mutator/itemstime.qc +++ b/qcsrc/common/mutators/mutator/itemstime.qc @@ -146,6 +146,15 @@ float Item_ItemsTime_UpdateTime(entity e, float t) MUTATOR_HOOKFUNCTION(itemstime, reset_map_global) { Item_ItemsTime_ResetTimes(); + // ALL the times need to be reset before .reset()ing each item + // since Item_Reset schedules respawn of superweapons and powerups + for (self = world; (self = nextent(self)); ) + if (IS_NOT_A_CLIENT(self)) + { + if (self.reset) + Item_ItemsTime_SetTime(self, 0); + } + Item_ItemsTime_SetTimesForAllPlayers(); } MUTATOR_HOOKFUNCTION(itemstime, MakePlayerObserver) { diff --git a/qcsrc/server/command/vote.qc b/qcsrc/server/command/vote.qc index 0ced8bb1f..4be48e124 100644 --- a/qcsrc/server/command/vote.qc +++ b/qcsrc/server/command/vote.qc @@ -357,15 +357,6 @@ void reset_map(float dorespawn) MUTATOR_CALLHOOK(reset_map_global); - // ALL the times need to be reset before .reset()ing each item - // since Item_Reset schedules respawn of superweapons and powerups - for(self = world; (self = nextent(self)); ) - if(IS_NOT_A_CLIENT(self)) - { - if(self.reset) - Item_ItemsTime_SetTime(self, 0); - } - for(self = world; (self = nextent(self)); ) if(IS_NOT_A_CLIENT(self)) { @@ -393,8 +384,6 @@ void reset_map(float dorespawn) } } - Item_ItemsTime_SetTimesForAllPlayers(); - FOR_EACH_PLAYER(self) if(self.frozen) Unfreeze(self);