]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'terencehill/itemstime_readyrestart_fix' into 'master'
authorTimePath <andrew.hardaker1995@gmail.com>
Tue, 25 Aug 2015 00:43:02 +0000 (00:43 +0000)
committerTimePath <andrew.hardaker1995@gmail.com>
Tue, 25 Aug 2015 00:43:02 +0000 (00:43 +0000)
Reset item times on warmup end / game restart

Fixes #1503

See merge request !184

qcsrc/server/command/vote.qc

index 4be48e124e82b98d38fb26c41c5df7dfe18efc29..0ced8bb1fbdbc7f4e8ac63a030ec62bdb14c0e04 100644 (file)
@@ -357,6 +357,15 @@ 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))
        {
@@ -384,6 +393,8 @@ void reset_map(float dorespawn)
                }
        }
 
+       Item_ItemsTime_SetTimesForAllPlayers();
+
        FOR_EACH_PLAYER(self)
        if(self.frozen)
                Unfreeze(self);