From: Rudolf Polzer Date: Sun, 11 Sep 2011 20:08:04 +0000 (+0200) Subject: selectteam: refuse changing to the team you're already on X-Git-Tag: xonotic-v0.6.0~40^2~143 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=6e980d6fe92f69bb91aed24d39681c7306391510;p=xonotic%2Fxonotic-data.pk3dir.git selectteam: refuse changing to the team you're already on --- diff --git a/qcsrc/server/clientcommands.qc b/qcsrc/server/clientcommands.qc index 13cddc0d2..f89d38363 100644 --- a/qcsrc/server/clientcommands.qc +++ b/qcsrc/server/clientcommands.qc @@ -277,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 {