]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/teamplay.qc
Teamplay: Added proper messages when joining spectator team.
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / teamplay.qc
index 79f23768ee62f9d81ab5803fa6d0e5b15200dcee..68f4d453fce506632a751abe121b6b29537d0a37 100644 (file)
@@ -214,8 +214,16 @@ bool SetPlayerTeam(entity player, int team_index, int type)
        LogTeamchange(player.playerid, player.team, type);
        if (team_index != old_team_index)
        {
-               Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(player.team,
-                       INFO_JOIN_PLAY_TEAM), player.netname);
+               if (team_index != -1)
+               {
+                       Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(
+                               player.team, INFO_JOIN_PLAY_TEAM), player.netname);
+               }
+               else
+               {
+                       Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_QUIT_SPECTATE,
+                               player.netname);
+               }
                KillPlayerForTeamChange(player);
        }
        return true;