From 9b914420344b4ea6402a462052ffa802042a3f44 Mon Sep 17 00:00:00 2001 From: terencehill Date: Wed, 23 Dec 2015 13:42:54 +0100 Subject: [PATCH] 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. --- qcsrc/server/teamplay.qc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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)); -- 2.39.2