From 1a1234b37f1d1d3fd764bbc022b42e6598add1fe Mon Sep 17 00:00:00 2001 From: Mario Date: Sun, 26 Jan 2014 08:15:27 +1100 Subject: [PATCH] Check if the team is available before killing the player --- qcsrc/server/command/cmd.qc | 11 +++++++++++ 1 file changed, 11 insertions(+) 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 -- 2.39.2