mirror of https://github.com/OpenRCT2/OpenRCT2.git
fix #3771: Crash when kicking player
The game did not check if the user hash existed in the map before trying to remove it.
This commit is contained in:
parent
c946d2fb06
commit
91b7db31d1
|
@ -184,7 +184,11 @@ void NetworkUserManager::UnsetUsersOfGroup(uint8 groupId)
|
|||
|
||||
void NetworkUserManager::RemoveUser(const std::string &hash)
|
||||
{
|
||||
_usersByHash[hash]->Remove = true;
|
||||
NetworkUser * networkUser = GetUserByHash(hash);
|
||||
if (networkUser != nullptr)
|
||||
{
|
||||
networkUser->Remove = true;
|
||||
}
|
||||
}
|
||||
|
||||
NetworkUser * NetworkUserManager::GetUserByHash(const std::string &hash)
|
||||
|
|
Loading…
Reference in New Issue