mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-17 03:53:07 +01:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user