From: TimePath Date: Mon, 24 Aug 2015 01:53:42 +0000 (+1000) Subject: Use more hooks X-Git-Tag: xonotic-v0.8.2~2042^2~5 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=7952fcdebfff604fac796f694fe338d75e74a990;p=xonotic%2Fxonotic-data.pk3dir.git Use more hooks --- 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)