From: Martin Taibr Date: Sat, 26 Nov 2016 19:34:46 +0000 (+0100) Subject: don't shuffle when teams are forced X-Git-Tag: xonotic-v0.8.2~340^2~1 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=5572cafea703113370767ffea0e26daa93e609a5;p=xonotic%2Fxonotic-data.pk3dir.git don't shuffle when teams are forced --- 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);