]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mutators/mutator/itemstime.qc
Merge branch 'terencehill/itemstime_checkmark2' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mutators / mutator / itemstime.qc
index 8ad72079a382c69ab5ba75e22ce3331cfcaab628..4d859b1fcab1438db82826be497093395af67a11 100644 (file)
@@ -149,24 +149,28 @@ float Item_ItemsTime_UpdateTime(entity e, float t)
     return t;
 }
 
-MUTATOR_HOOKFUNCTION(itemstime, reset_map_global) {
+MUTATOR_HOOKFUNCTION(itemstime, reset_map_global)
+{SELFPARAM();
     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))
+    for (entity e = NULL; (e = nextent(e)); )
+    if (IS_NOT_A_CLIENT(e))
     {
+        setself(e);
         if (self.reset)
             Item_ItemsTime_SetTime(self, 0);
     }
     Item_ItemsTime_SetTimesForAllPlayers();
 }
 
-MUTATOR_HOOKFUNCTION(itemstime, MakePlayerObserver) {
+MUTATOR_HOOKFUNCTION(itemstime, MakePlayerObserver)
+{SELFPARAM();
     Item_ItemsTime_SetTimesForPlayer(self);
 }
 
-MUTATOR_HOOKFUNCTION(itemstime, PlayerSpawn) {
+MUTATOR_HOOKFUNCTION(itemstime, PlayerSpawn)
+{SELFPARAM();
     if (warmup_stage) return;
     Item_ItemsTime_ResetTimesForPlayer(self);
 }