From: terencehill Date: Wed, 23 Dec 2015 12:42:54 +0000 (+0100) Subject: Fix a bug where the message "You cannot change to a larger team" was displayed in... X-Git-Tag: xonotic-v0.8.2~1428^2~2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=9b914420344b4ea6402a462052ffa802042a3f44;p=xonotic%2Fxonotic-data.pk3dir.git Fix a bug where the message "You cannot change to a larger team" was displayed in the console in team games on connection depending on your own player colors. --- diff --git a/qcsrc/server/teamplay.qc b/qcsrc/server/teamplay.qc index 0662aab68..80b0817ca 100644 --- a/qcsrc/server/teamplay.qc +++ b/qcsrc/server/teamplay.qc @@ -588,6 +588,13 @@ void SV_ChangeTeam(float _color) return; } + if(!IS_CLIENT(self)) + { + // since this is an engine function, and gamecode doesn't have any calls earlier than this, do the connecting message here + Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_CONNECTING, self.netname); + return; + } + scolor = self.clientcolors & 0x0F; dcolor = _color & 0x0F; @@ -647,10 +654,6 @@ void SV_ChangeTeam(float _color) TeamchangeFrags(self); } - // since this is an engine function, and gamecode doesn't have any calls earlier than this, do the connecting message here - if(!IS_CLIENT(self)) - Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_CONNECTING, self.netname); - MUTATOR_CALLHOOK(Player_ChangeTeam, self, steam, dteam); SetPlayerTeam(self, dteam, steam, !IS_CLIENT(self));