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 c0686dc commit 00b7ac5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/PlayerManager.cpp
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

1 comment on commit 00b7ac5

@sigsegv-mvm
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For anyone looking through the commit logs, this unassuming-looking patch almost certainly fixes #748.

Please sign in to comment.