]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/arena.qc
Merge remote-tracking branch 'origin/master' into samual/notification_rewrite
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / arena.qc
index 31698e92294590fd90c58605ab052c44e777c561..bb52a4ae25505d7ba4ec9de4914ecae2fa6299f8 100644 (file)
@@ -47,7 +47,7 @@ void reset_map(float dorespawn)
        race_ReadyRestart();
 
        for(self = world; (self = nextent(self)); )
-       if(clienttype(self) == CLIENTTYPE_NOTACLIENT && self.items != IT_STRENGTH && self.items != IT_INVINCIBLE) // don't respawn strength or shield, that will only lead to them spawning very early each match
+       if(clienttype(self) == CLIENTTYPE_NOTACLIENT)
        {
                if(self.reset)
                {
@@ -197,9 +197,15 @@ void Arena_Warmup()
 
        if(gameover)
        {
+               if(warmup && time < warmup)
+               {
+                       FOR_EACH_REALCLIENT(e)
+                               Send_CSQC_Centerprint_Generic_Expire(e, CPID_ROUND_STARTING);
+                       warmup = 0;
+               }
                if(champion && g_arena)
                {
-                       FOR_EACH_CLIENT(e)
+                       FOR_EACH_REALCLIENT(e)
                                centerprint(e, strcat("The Champion is ", champion.netname));
                        champion = world;
                }
@@ -221,14 +227,14 @@ void Arena_Warmup()
                        allowed_to_spawn = 1;
                if(champion && g_arena)
                {
-                       FOR_EACH_PLAYER(e)
+                       FOR_EACH_REALCLIENT(e)
                                centerprint(e, strcat("The Champion is ", champion.netname));
                }
 
                if(f != roundStartTime_prev) {
                        roundStartTime_prev = f;
                        if(g_ca && !(red_players && blue_players)) {
-                               FOR_EACH_PLAYER(self)
+                               FOR_EACH_REALCLIENT(self)
                                        Send_CSQC_Centerprint_Generic(self, CPID_ROUND_STARTING, "^1Need at least 1 player in each team to play CA", 2, 0);
                                warmup = time + autocvar_g_ca_warmup;
                        } else {
@@ -241,7 +247,7 @@ void Arena_Warmup()
                                else if(f == 1)
                                        Announce("1");
 
-                               FOR_EACH_PLAYER(e)
+                               FOR_EACH_REALCLIENT(e)
                                        Send_CSQC_Centerprint_Generic(e, CPID_ROUND_STARTING, "Round will start in %d", 1, f);
                        }
                }
@@ -250,10 +256,7 @@ void Arena_Warmup()
                        FOR_EACH_CLIENT(e)
                        {
                                if(e.spawned && e.classname == "player")
-                                       e.movetype = MOVETYPE_NONE;
-                               e.velocity = '0 0 0';
-                               e.avelocity = '0 0 0';
-                               e.movement = '0 0 0';
+                                       e.player_blocked = 1;
                        }
                }
        }
@@ -267,15 +270,15 @@ void Arena_Warmup()
                                reset_map(TRUE);
                } else {
                        Announce("begin");
-                       FOR_EACH_PLAYER(e)
+                       FOR_EACH_REALCLIENT(e)
                                Send_CSQC_Centerprint_Generic(e, CPID_ROUND_STARTING, "^1Begin!", 1, 0);
                }
 
                if(g_arena) {
-                       FOR_EACH_PLAYER(e)
+                       FOR_EACH_CLIENT(e)
                        {
-                               if(e.health > 0 && e.movetype == MOVETYPE_NONE)
-                                       e.movetype = MOVETYPE_WALK;
+                               if(e.player_blocked)
+                                       e.player_blocked = 0;
                        }
                }
        }
@@ -290,22 +293,22 @@ void count_players()
        // count amount of players in each team
        total_players = red_players = blue_players = yellow_players = pink_players = 0;
        FOR_EACH_PLAYER(self) {
-               if (self.team == COLOR_TEAM1)
+               if (self.team == FL_TEAM_1)
                {
                        red_players += 1;
                        total_players += 1;
                }
-               else if (self.team == COLOR_TEAM2)
+               else if (self.team == FL_TEAM_2)
                {
                        blue_players += 1;
                        total_players += 1;
                }
-               else if (self.team == COLOR_TEAM3)
+               else if (self.team == FL_TEAM_3)
                {
                        yellow_players += 1;
                        total_players += 1;
                }
-               else if (self.team == COLOR_TEAM4)
+               else if (self.team == FL_TEAM_4)
                {
                        pink_players += 1;
                        total_players += 1;
@@ -319,12 +322,12 @@ void count_alive_players()
        if(g_ca)
        {
                FOR_EACH_PLAYER(self) {
-                       if (self.team == COLOR_TEAM1 && self.health >= 1)
+                       if (self.team == FL_TEAM_1 && self.health >= 1)
                        {
                                redalive += 1;
                                totalalive += 1;
                        }
-                       else if (self.team == COLOR_TEAM2 && self.health >= 1)
+                       else if (self.team == FL_TEAM_2 && self.health >= 1)
                        {
                                bluealive += 1;
                                totalalive += 1;
@@ -339,22 +342,22 @@ void count_alive_players()
        {
                // count amount of alive players in each team
                FOR_EACH_PLAYER(self) {
-                       if (self.team == COLOR_TEAM1 && self.freezetag_frozen == 0 && self.health >= 1)
+                       if (self.team == FL_TEAM_1 && self.freezetag_frozen == 0 && self.health >= 1)
                        {
                                redalive += 1;
                                totalalive += 1;
                        }
-                       else if (self.team == COLOR_TEAM2 && self.freezetag_frozen == 0 && self.health >= 1)
+                       else if (self.team == FL_TEAM_2 && self.freezetag_frozen == 0 && self.health >= 1)
                        {
                                bluealive += 1;
                                totalalive += 1;
                        }
-                       else if (self.team == COLOR_TEAM3 && self.freezetag_frozen == 0 && self.health >= 1)
+                       else if (self.team == FL_TEAM_3 && self.freezetag_frozen == 0 && self.health >= 1)
                        {
                                yellowalive += 1;
                                totalalive += 1;
                        }
-                       else if (self.team == COLOR_TEAM4 && self.freezetag_frozen == 0 && self.health >= 1)
+                       else if (self.team == FL_TEAM_4 && self.freezetag_frozen == 0 && self.health >= 1)
                        {
                                pinkalive += 1;
                                totalalive += 1;
@@ -379,7 +382,7 @@ void count_alive_players()
  */
 void Spawnqueue_Check()
 {
-       if(warmup == 0 && g_ca)
+       if(warmup == 0 && g_ca && !inWarmupStage)
        {
                if(red_players || blue_players)
                        reset_map(TRUE);
@@ -397,12 +400,12 @@ void Spawnqueue_Check()
                                if(redalive) {
                                        play2all("ctf/red_capture.wav");
                                        FOR_EACH_CLIENT(self) centerprint(self, "^1RED ^7team wins the round");
-                                       TeamScore_AddToTeam(COLOR_TEAM1, ST_SCORE, +1);
+                                       TeamScore_AddToTeam(FL_TEAM_1, ST_SCORE, +1);
                                }
                                else if(bluealive) {
                                        play2all("ctf/blue_capture.wav");
                                        FOR_EACH_CLIENT(self) centerprint(self, "^4BLUE ^7team wins the round");
-                                       TeamScore_AddToTeam(COLOR_TEAM2, ST_SCORE, +1);
+                                       TeamScore_AddToTeam(FL_TEAM_2, ST_SCORE, +1);
                                }
                                else
                                        FOR_EACH_CLIENT(self) centerprint(self, "^7Round tied");