]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Use more hooks
authorTimePath <andrew.hardaker1995@gmail.com>
Mon, 24 Aug 2015 01:53:42 +0000 (11:53 +1000)
committerTimePath <andrew.hardaker1995@gmail.com>
Mon, 24 Aug 2015 01:53:42 +0000 (11:53 +1000)
qcsrc/common/mutators/mutator/itemstime.qc
qcsrc/server/cl_client.qc

index 85e5caaf56d747277889efc341170b11f7fd4bf7..b20cfbff317038378de093c086939e530cc235f0 100644 (file)
@@ -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
index 81ea03e0eb4bf7556b3a01899947b8c788dfef3f..9a832efd4d67449fdb99f533603e427adf0356ac 100644 (file)
@@ -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)