]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
fixed for forced team
authorRudolf Polzer <divverent@alientrap.org>
Sat, 13 Nov 2010 21:29:40 +0000 (22:29 +0100)
committerRudolf Polzer <divverent@alientrap.org>
Sat, 13 Nov 2010 21:30:36 +0000 (22:30 +0100)
qcsrc/server/cl_client.qc
qcsrc/server/clientcommands.qc
qcsrc/server/teamplay.qc

index bb3e4774a96d304c690e30c3ba11fad8f6e8553f..97bffaacc43b9dc22f706b11ce019f1d73bbd76d 100644 (file)
@@ -2388,7 +2388,7 @@ void ShowRespawnCountdown()
 void LeaveSpectatorMode()
 {
        if(isJoinAllowed()) {
-               if(!teams_matter || cvar("g_campaign") || cvar("g_balance_teams") || (self.wasplayer && cvar("g_changeteam_banned"))) {
+               if(!teams_matter || cvar("g_campaign") || cvar("g_balance_teams") || (self.wasplayer && cvar("g_changeteam_banned")) || self.team_forced > 0) {
                        self.classname = "player";
 
                        if(cvar("g_campaign") || cvar("g_balance_teams") || cvar("g_balance_teams_force"))
index df19ab592f4779beb94a38881992e37150a43ae0..0cbe3017eae1ef889844324e8649a1c6cf036d8b 100644 (file)
@@ -171,7 +171,7 @@ void SV_ParseClientCommand(string s) {
                        PutClientInServer();
                } else if(cvar("g_campaign") || cvar("g_balance_teams") || cvar("g_balance_teams_force")) {
                        //JoinBestTeam(self, FALSE, TRUE);
-               } else if(teams_matter && !cvar("sv_spectate")) {
+               } else if(teams_matter && !cvar("sv_spectate") && !(self.team_forced > 0)) {
                        self.classname = "observer";
                        stuffcmd(self,"menu_showteamselect\n");
                }
@@ -249,9 +249,11 @@ void SV_ParseClientCommand(string s) {
                if not(self.flags & FL_CLIENT)
                        return;
                if( !teams_matter ) {
-                       sprint( self, "selecteam can only be used in teamgames\n");
+                       sprint( self, "selectteam can only be used in teamgames\n");
                } else if(cvar("g_campaign")) {
                        //JoinBestTeam(self, 0);
+               } else if(self.team_forced > 0) {
+                       sprint( self, "selectteam can not be used as your team is forced\n");
                } else if(lockteams) {
                        sprint( self, "^7The game has already begun, you must wait until the next map to be able to join a team.\n");
                } else if( argv(1) == "red" ) {
index d784c72d8fa64d0d7f4a234f5a370f5cb98cd1db..b9064c783b852a515586ade5e0826b3323380bf9 100644 (file)
@@ -803,7 +803,7 @@ float FindSmallestTeam(entity pl, float ignore_pl)
        if(c4 >= 0)
                totalteams = totalteams + 1;
 
-       if(cvar("bot_vs_human") && totalteams == 1)
+       if((cvar("bot_vs_human") || pl.team_forced > 0) && totalteams == 1)
                totalteams += 1;
 
        if(totalteams <= 1)