Skip to content

Commit

Permalink
Add bounds check for userid reset on disconnect (#1108)
Browse files Browse the repository at this point in the history
  • Loading branch information
Headline committed Oct 31, 2019
1 parent e433dbf commit 8c380e4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/PlayerManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down

0 comments on commit 8c380e4

Please sign in to comment.