From: terencehill Date: Sat, 19 Jan 2019 22:45:12 +0000 (+0100) Subject: Fix half part of #2191: 'Player is now spectating' isn't shown in teamless games... X-Git-Tag: xonotic-v0.8.5~1657 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=6b734896802520a4b27a0e15abac9e830c9f435f;p=xonotic%2Fxonotic-data.pk3dir.git Fix half part of #2191: 'Player is now spectating' isn't shown in teamless games (bug introduced by the commit 2f163ba8) --- diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index fe0c04179..c5d985401 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -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) diff --git a/qcsrc/server/teamplay.qc b/qcsrc/server/teamplay.qc index a30103645..d9682ed6a 100644 --- a/qcsrc/server/teamplay.qc +++ b/qcsrc/server/teamplay.qc @@ -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; }