]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/arena.qc
Freeze Tag. It compiles. Untested. (don't test :P)
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / arena.qc
index 046743151dbc02fd27dbd706a77d8065418397b6..b80a2830cd9748383a6b604ac4da56e887f7400d 100644 (file)
@@ -262,8 +262,8 @@ void Arena_Warmup()
 
 float next_round;
 float stopalivecheck;
-float redalive, bluealive;
-.float redalive_stat, bluealive_stat;
+float redalive, bluealive, yellowalive, pinkalive;
+.float redalive_stat, bluealive_stat, yellowalive_stat, pinkalive_stat;
 /**
  * This function finds out whether an arena round is over 1 player is left.
  * It determines the last player who's still alive and saves it's entity reference
@@ -289,6 +289,22 @@ void Spawnqueue_Check()
                        self.bluealive_stat = bluealive;
                }
        }
+       else if(g_freezetag)
+       {
+               redalive = 0; bluealive = 0;
+               FOR_EACH_PLAYER(self) {
+                       if (self.team == COLOR_TEAM1 && self.freezetag_frozen == 0 && self.health >= 1) redalive += 1;
+                       else if (self.team == COLOR_TEAM2 && self.freezetag_frozen == 0 && self.health >= 1) bluealive += 1;
+                       else if (self.team == COLOR_TEAM3 && self.freezetag_frozen == 0 && self.health >= 1) yellowalive += 1;
+                       else if (self.team == COLOR_TEAM4 && self.freezetag_frozen == 0 && self.health >= 1) pinkalive += 1;
+               }
+               FOR_EACH_PLAYER(self) {
+                       self.redalive_stat = redalive;
+                       self.bluealive_stat = bluealive;
+                       self.yellowalive_stat = yellowalive;
+                       self.pinkalive_stat = pinkalive;
+               }
+       }
        if(time < warmup + 1 || inWarmupStage)
                return;