]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Check if the team is available before killing the player
authorMario <mario.mario@y7mail.com>
Sat, 25 Jan 2014 21:15:27 +0000 (08:15 +1100)
committerMario <mario.mario@y7mail.com>
Sat, 25 Jan 2014 21:15:27 +0000 (08:15 +1100)
qcsrc/server/command/cmd.qc

index 9f636416a692486d53e0564cf892435f0b4dcee6..c8c87e09687f49a6df6e356acd6e58eaf9cd2255 100644 (file)
@@ -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