From: Mario Date: Sat, 25 Jan 2014 21:15:27 +0000 (+1100) Subject: Check if the team is available before killing the player X-Git-Tag: xonotic-v0.8.0~234^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=1a1234b37f1d1d3fd764bbc022b42e6598add1fe;p=xonotic%2Fxonotic-data.pk3dir.git Check if the team is available before killing the player --- diff --git a/qcsrc/server/command/cmd.qc b/qcsrc/server/command/cmd.qc index 9f636416a..c8c87e096 100644 --- a/qcsrc/server/command/cmd.qc +++ b/qcsrc/server/command/cmd.qc @@ -453,7 +453,18 @@ void ClientCommand_selectteam(float request, float argc) else if(self.wasplayer && autocvar_g_changeteam_banned) sprint(self, "^1You cannot change team, forbidden by the server.\n"); else + { + if(autocvar_g_balance_teams && autocvar_g_balance_teams_prevent_imbalance) + { + GetTeamCounts(self); + if(!TeamSmallerEqThanTeam(selection, self.team, self)) + { + sprint(self, "Cannot change to a larger/better/shinier team\n"); + return; + } + } ClientKill_TeamChange(selection); + } } } else