]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
shuffleteams: properly detect ca players. It fixes #1471 "Shuffleteams results in...
authorterencehill <piuntn@gmail.com>
Thu, 11 Jun 2015 22:57:24 +0000 (00:57 +0200)
committerterencehill <piuntn@gmail.com>
Thu, 11 Jun 2015 22:57:24 +0000 (00:57 +0200)
qcsrc/server/command/sv_cmd.qc

index 43c53792e5a755ea5e991625924974ac30b40f78..0bf2df320b9475adfddeb9e7ba8c2782b87a5053 100644 (file)
@@ -1399,7 +1399,8 @@ void GameCommand_shuffleteams(float request)
                                // count the total amount of players and total amount of teams
                                t_players = 0;
                                t_teams = 0;
-                               FOR_EACH_PLAYER(tmp_player)
+                               FOR_EACH_CLIENT(tmp_player)
+                               if(IS_PLAYER(tmp_player) || tmp_player.caplayer)
                                {
                                        CheckAllowedTeams(tmp_player);
 
@@ -1412,7 +1413,8 @@ void GameCommand_shuffleteams(float request)
                                }
 
                                // build a list of the players in a random order
-                               FOR_EACH_PLAYER(tmp_player)
+                               FOR_EACH_CLIENT(tmp_player)
+                               if(IS_PLAYER(tmp_player) || tmp_player.caplayer)
                                {
                                        for (;;)
                                        {