]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix half part of #2191: 'Player is now spectating' isn't shown in teamless games...
authorterencehill <piuntn@gmail.com>
Sat, 19 Jan 2019 22:45:12 +0000 (23:45 +0100)
committerterencehill <piuntn@gmail.com>
Sat, 19 Jan 2019 22:45:12 +0000 (23:45 +0100)
qcsrc/server/client.qc
qcsrc/server/teamplay.qc

index fe0c04179ddcec573cb03e0fa7511ab039dc97c8..c5d985401968a2d79e830d07c3ea17d7fc917494 100644 (file)
@@ -381,7 +381,7 @@ void PutObserverInServer(entity this)
                if(axh.owner == this && axh != NULL && !wasfreed(axh))
                        delete(axh);
        }
-       
+
        if (mutator_returnvalue)
        {
                // mutator prevents resetting teams+score
@@ -390,7 +390,9 @@ void PutObserverInServer(entity this)
        {
                SetPlayerTeam(this, -1, TEAM_CHANGE_SPECTATOR);
                this.frags = FRAGS_SPECTATOR;
-    }
+       }
+       if (CS(this).just_joined)
+               CS(this).just_joined = false;
 }
 
 int player_getspecies(entity this)
index a30103645d344a640b4c08751d65ef6dd239dcaa..d9682ed6acffcbfe81c791f43c578e08f0e8c58a 100644 (file)
@@ -227,10 +227,6 @@ bool SetPlayerTeam(entity player, int team_index, int type)
                                Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_QUIT_SPECTATE,
                                        player.netname);
                        }
-                       else
-                       {
-                               CS(player).just_joined = false;
-                       }
                }
                KillPlayerForTeamChange(player);
                if (!IS_BOT_CLIENT(player))
@@ -238,6 +234,11 @@ bool SetPlayerTeam(entity player, int team_index, int type)
                        TeamBalance_AutoBalanceBots();
                }
        }
+       else if (team_index == -1)
+       {
+               if (!CS(player).just_joined)
+                       Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_QUIT_SPECTATE, player.netname);
+       }
        return true;
 }