From 8262fbc8644f600676875a7c2d1bd03bdc0adb6c Mon Sep 17 00:00:00 2001 From: TimePath Date: Tue, 25 Aug 2015 10:48:47 +1000 Subject: [PATCH] Use the reset_map_global hook --- qcsrc/common/mutators/mutator/itemstime.qc | 9 +++++++++ qcsrc/server/command/vote.qc | 11 ----------- 2 files changed, 9 insertions(+), 11 deletions(-) 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); -- 2.39.2