]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/teamplay.qc
Merge branch 'terencehill/connection_msg_fix' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / teamplay.qc
index 15d33f5341527f5e03ad5fa4b5c62960c66e8d2f..1cd11b6854cc574277eed9b3a01014d274232267 100644 (file)
@@ -581,11 +581,19 @@ void SV_ChangeTeam(float _color)
        float scolor, dcolor, steam, dteam; //, dbotcount, scount, dcount;
 
        // in normal deathmatch we can just apply the color and we're done
        float scolor, dcolor, steam, dteam; //, dbotcount, scount, dcount;
 
        // in normal deathmatch we can just apply the color and we're done
-       if(!teamplay) {
+       if(!teamplay)
                SetPlayerColors(self, _color);
                SetPlayerColors(self, _color);
+
+       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;
        }
 
                return;
        }
 
+       if(!teamplay)
+               return;
+
        scolor = self.clientcolors & 0x0F;
        dcolor = _color & 0x0F;
 
        scolor = self.clientcolors & 0x0F;
        dcolor = _color & 0x0F;
 
@@ -645,10 +653,6 @@ void SV_ChangeTeam(float _color)
                TeamchangeFrags(self);
        }
 
                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));
        MUTATOR_CALLHOOK(Player_ChangeTeam, self, steam, dteam);
 
        SetPlayerTeam(self, dteam, steam, !IS_CLIENT(self));