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 GitHub
parent c0686dc4f9
commit 00b7ac5a39
+4 -1
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();
}