1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-15 11:03:00 +01:00

Fix game crashing/freezing when kicking players in MP.

This commit is contained in:
ZehM4tt
2017-06-21 02:00:14 +02:00
committed by Michael Steenbeek
parent 8ffe50728a
commit 81572e9592

View File

@@ -2696,6 +2696,11 @@ void game_command_kick_player(sint32 *eax, sint32 *ebx, sint32 *ecx, sint32 *edx
{
uint8 playerid = (uint8)*eax;
NetworkPlayer* player = gNetwork.GetPlayerByID(playerid);
if (player == nullptr) {
// Player might be already removed by the PLAYERLIST command, need to refactor non-game commands executing too early.
return;
}
if (player && player->Flags & NETWORK_PLAYER_FLAG_ISSERVER) {
gGameCommandErrorTitle = STR_CANT_KICK_THE_HOST;
gGameCommandErrorText = STR_NONE;