]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/clientcommands.qc
fix a NIX issue
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / clientcommands.qc
index c1d3162a5739da2da60f6604d6f4a72368414aaa..f89d383631c453c35f2d64ee2fd0d82528d56a6e 100644 (file)
@@ -239,6 +239,11 @@ void SV_ParseClientCommand(string s) {
                if(self.classname == "player" && autocvar_sv_spectate == 1) {
                        ClientKill_TeamChange(-2); // observe
                }
+               if(g_ca && self.caplayer && (self.classname == "spectator" || self.classname == "observer")) {
+                       // in CA, allow a dead player to move to spectatators (without that, caplayer!=0 will be moved back to the player list)
+                       sprint(self, "WARNING: you will spectate in the next round.\n");
+                       self.caplayer = 0;
+               }
        } else if(cmd == "join") {
                if not(self.flags & FL_CLIENT)
                        return;
@@ -257,7 +262,7 @@ void SV_ParseClientCommand(string s) {
                        }
                        else {
                                //player may not join because of g_maxplayers is set
-                               centerprint_atprio(self, CENTERPRIO_MAPVOTE, PREVENT_JOIN_TEXT);
+                               centerprint(self, PREVENT_JOIN_TEXT);
                        }
                }
        } else if( cmd == "selectteam" ) {
@@ -272,13 +277,25 @@ void SV_ParseClientCommand(string s) {
                } 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" ) {
-                       ClientKill_TeamChange(COLOR_TEAM1);
+                       if(self.team != COLOR_TEAM1 || self.deadflag != DEAD_NO)
+                               ClientKill_TeamChange(COLOR_TEAM1);
+                       else
+                               sprint( self, "^7You already are on that team.\n");
                } else if( argv(1) == "blue" ) {
-                       ClientKill_TeamChange(COLOR_TEAM2);
+                       if(self.team != COLOR_TEAM2 || self.deadflag != DEAD_NO)
+                               ClientKill_TeamChange(COLOR_TEAM2);
+                       else
+                               sprint( self, "^7You already are on that team.\n");
                } else if( argv(1) == "yellow" ) {
-                       ClientKill_TeamChange(COLOR_TEAM3);
+                       if(self.team != COLOR_TEAM3 || self.deadflag != DEAD_NO)
+                               ClientKill_TeamChange(COLOR_TEAM3);
+                       else
+                               sprint( self, "^7You already are on that team.\n");
                } else if( argv(1) == "pink" ) {
-                       ClientKill_TeamChange(COLOR_TEAM4);
+                       if(self.team != COLOR_TEAM4 || self.deadflag != DEAD_NO)
+                               ClientKill_TeamChange(COLOR_TEAM4);
+                       else
+                               sprint( self, "^7You already are on that team.\n");
                } else if( argv(1) == "auto" ) {
                        ClientKill_TeamChange(-1);
                } else {