diff --git a/src/game/server/player.cpp b/src/game/server/player.cpp index 0a914f62e..2f3270e49 100644 --- a/src/game/server/player.cpp +++ b/src/game/server/player.cpp @@ -631,7 +631,13 @@ void CPlayer::SetTeam(int Team, bool DoChatMsg) { CGameControllerDDRace *Controller = (CGameControllerDDRace *)GameServer()->m_pController; if(g_Config.m_SvTeam != 3) + { + // Joining spectators should not kill a locked team, but should still + // check if the team finished by you leaving it. + int DDRTeam = m_pCharacter->Team(); Controller->m_Teams.SetForceCharacterTeam(m_ClientID, TEAM_FLOCK); + Controller->m_Teams.CheckTeamFinished(DDRTeam); + } } KillCharacter(); diff --git a/src/game/server/teams.h b/src/game/server/teams.h index f2f446707..192126d5b 100644 --- a/src/game/server/teams.h +++ b/src/game/server/teams.h @@ -19,7 +19,6 @@ class CGameTeams class CGameContext *m_pGameContext; - void CheckTeamFinished(int ClientID); bool TeamFinished(int Team); void OnTeamFinish(CPlayer **Players, unsigned int Size, float Time, const char *pTimestamp); void OnFinish(CPlayer *Player, float Time, const char *pTimestamp); @@ -62,6 +61,7 @@ public: void OnCharacterDeath(int ClientID, int Weapon); bool SetCharacterTeam(int ClientID, int Team); + void CheckTeamFinished(int ClientID); void ChangeTeamState(int Team, int State); void onChangeTeamState(int Team, int State, int OldState);