]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Disallow changing to invalid team. Fixes #1964. 505/head
authorLyberta <lyberta@lyberta.net>
Fri, 24 Nov 2017 21:53:13 +0000 (00:53 +0300)
committerLyberta <lyberta@lyberta.net>
Fri, 24 Nov 2017 21:53:13 +0000 (00:53 +0300)
qcsrc/server/teamplay.qc

index 12aca2133a0f67aa48a09d9bd9e8a07eee5f73e2..fd73969cb81a9d16cb88c55b02bee012cd0dfaa1 100644 (file)
@@ -925,6 +925,11 @@ void SV_ChangeTeam(entity this, float _color)
        source_team = Team_TeamToNumber(source_color + 1);
        destination_team = Team_TeamToNumber(destination_color + 1);
 
+       if (destination_team == -1)
+       {
+               return;
+       }
+
        CheckAllowedTeams(this);
 
        if (destination_team == 1 && c1 < 0) destination_team = 4;