From 5572cafea703113370767ffea0e26daa93e609a5 Mon Sep 17 00:00:00 2001 From: Martin Taibr Date: Sat, 26 Nov 2016 20:34:46 +0100 Subject: [PATCH] don't shuffle when teams are forced --- qcsrc/server/command/sv_cmd.qc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/qcsrc/server/command/sv_cmd.qc b/qcsrc/server/command/sv_cmd.qc index b9ac09f19..f99ed23b2 100644 --- a/qcsrc/server/command/sv_cmd.qc +++ b/qcsrc/server/command/sv_cmd.qc @@ -1331,6 +1331,16 @@ void GameCommand_shuffleteams(float request) return; } + FOREACH_CLIENT(IS_PLAYER(it) || it.caplayer, LAMBDA( + if (it.team_forced) { + // we could theoretically assign forced players to their teams + // and shuffle the rest to fill the empty spots but in practise + // either all players or none are gonna have forced teams + LOG_INFO("Can't shuffle teams because at least one player has a forced team.\n"); + return; + } + )); + int number_of_teams = 0; CheckAllowedTeams(NULL); if (c1 >= 0) number_of_teams = max(1, number_of_teams); -- 2.39.2