From: Lyberta Date: Fri, 24 Nov 2017 21:53:13 +0000 (+0300) Subject: Disallow changing to invalid team. Fixes #1964. X-Git-Tag: xonotic-v0.8.5~2432^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8667efaf4448e9033aa09fd105b0bc741efd9092;p=xonotic%2Fxonotic-data.pk3dir.git Disallow changing to invalid team. Fixes #1964. --- diff --git a/qcsrc/server/teamplay.qc b/qcsrc/server/teamplay.qc index 12aca2133..fd73969cb 100644 --- a/qcsrc/server/teamplay.qc +++ b/qcsrc/server/teamplay.qc @@ -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;