]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into terencehill/ca_fixes
authorterencehill <piuntn@gmail.com>
Thu, 30 Jan 2014 00:58:16 +0000 (01:58 +0100)
committerterencehill <piuntn@gmail.com>
Thu, 30 Jan 2014 00:58:16 +0000 (01:58 +0100)
1  2 
qcsrc/server/command/cmd.qc

index 5de404e311d0df9b3ef2177926ca0b18d8b67eef,c8c87e09687f49a6df6e356acd6e58eaf9cd2255..40f7ed406c7b72299f45b96318b118d02305fc6b
@@@ -152,8 -152,6 +152,8 @@@ void ClientCommand_join(float request
                        {
                                if(!IS_PLAYER(self) && !lockteams)
                                {
 +                                      if(self.caplayer)
 +                                              return;
                                        if(nJoinAllowed(self))
                                        {
                                                if(autocvar_g_campaign) { campaign_bots_may_start = 1; }
@@@ -455,7 -453,18 +455,18 @@@ void ClientCommand_selectteam(float req
                                                                        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
@@@ -564,11 -573,15 +575,11 @@@ void ClientCommand_spectate(float reque
                                        }
                                }
  
 -                              if(IS_PLAYER(self) && autocvar_sv_spectate == 1)
 -                                      ClientKill_TeamChange(-2); // observe
 -
 -                              // in CA, allow a dead player to move to spectators (without that, caplayer!=0 will be moved back to the player list)
 -                              // note: if arena game mode is ever done properly, this needs to be removed.
 -                              if(self.caplayer && (IS_SPEC(self) || IS_OBSERVER(self)))
 +                              if((IS_PLAYER(self) || self.caplayer) && autocvar_sv_spectate == 1)
                                {
 -                                      sprint(self, "WARNING: you will spectate in the next round.\n");
 -                                      self.caplayer = 0;
 +                                      if(self.caplayer && (IS_SPEC(self) || IS_OBSERVER(self)))
 +                                              sprint(self, "WARNING: you will spectate in the next round.\n");
 +                                      ClientKill_TeamChange(-2); // observe
                                }
                        }
                        return; // never fall through to usage