From 7952fcdebfff604fac796f694fe338d75e74a990 Mon Sep 17 00:00:00 2001 From: TimePath Date: Mon, 24 Aug 2015 11:53:42 +1000 Subject: [PATCH] Use more hooks --- qcsrc/common/mutators/mutator/itemstime.qc | 9 +++++++++ qcsrc/server/cl_client.qc | 4 ---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/qcsrc/common/mutators/mutator/itemstime.qc b/qcsrc/common/mutators/mutator/itemstime.qc index 85e5caaf5..b20cfbff3 100644 --- a/qcsrc/common/mutators/mutator/itemstime.qc +++ b/qcsrc/common/mutators/mutator/itemstime.qc @@ -198,4 +198,13 @@ MUTATOR_HOOKFUNCTION(itemstime, reset_map_global) { Item_ItemsTime_ResetTimes(); } +MUTATOR_HOOKFUNCTION(itemstime, MakePlayerObserver) { + Item_ItemsTime_SetTimesForPlayer(self); +} + +MUTATOR_HOOKFUNCTION(itemstime, PlayerSpawn) { + if (warmup_stage) return; + Item_ItemsTime_ResetTimesForPlayer(self); +} + #endif diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index 81ea03e0e..9a832efd4 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -197,7 +197,6 @@ void PutObserverInServer (void) if(IS_REAL_CLIENT(self)) { - Item_ItemsTime_SetTimesForPlayer(self); msg_entity = self; WriteByte(MSG_ONE, SVC_SETVIEW); WriteEntity(MSG_ONE, self); @@ -507,9 +506,6 @@ void PutClientInServer (void) else self.superweapons_finished = 0; - if(!warmup_stage) - Item_ItemsTime_ResetTimesForPlayer(self); - if(g_weaponarena_random) // WEAPONTODO: more stuff that should be in a mutator. also: rename those cvars { if(g_weaponarena_random_with_blaster) -- 2.39.2