Check for m_pCharacter before accessing it (fixes #3372)

This commit is contained in:
def 2020-12-02 10:32:50 +01:00 committed by heinrich5991
parent 0848df797a
commit b63d20a6e0

View file

@ -630,7 +630,7 @@ void CPlayer::SetTeam(int Team, bool DoChatMsg)
if(Team == TEAM_SPECTATORS)
{
CGameControllerDDRace *Controller = (CGameControllerDDRace *)GameServer()->m_pController;
if(g_Config.m_SvTeam != 3)
if(g_Config.m_SvTeam != 3 && m_pCharacter)
{
// Joining spectators should not kill a locked team, but should still
// check if the team finished by you leaving it.