]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Use the reset_map_global hook
authorTimePath <andrew.hardaker1995@gmail.com>
Tue, 25 Aug 2015 00:48:47 +0000 (10:48 +1000)
committerTimePath <andrew.hardaker1995@gmail.com>
Tue, 25 Aug 2015 00:48:47 +0000 (10:48 +1000)
qcsrc/common/mutators/mutator/itemstime.qc
qcsrc/server/command/vote.qc

index ca65c2c48f0f9bcf0daac6616ea211cd1305d232..ee571790a3859f8f7bf88b470d5a5e867d01bce4 100644 (file)
@@ -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) {
index 0ced8bb1fbdbc7f4e8ac63a030ec62bdb14c0e04..4be48e124e82b98d38fb26c41c5df7dfe18efc29 100644 (file)
@@ -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);