Add bounds check for userid reset on disconnect (#1108)

This commit is contained in:
Headline 2019-10-30 17:17:53 -07:00 committed by Michael Flaherty
parent b2b29cb33f
commit 3c948997e0

View File

@ -1474,7 +1474,10 @@ void PlayerManager::InvalidatePlayer(CPlayer *pPlayer)
} }
} }
m_UserIdLookUp[engine->GetPlayerUserId(pPlayer->m_pEdict)] = 0; auto userid = engine->GetPlayerUserId(pPlayer->m_pEdict);
if (userid != -1)
m_UserIdLookUp[userid] = 0;
pPlayer->Disconnect(); pPlayer->Disconnect();
} }