From f69c95f907a212355b54fe8a0627e7c45e08b6eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= Date: Sun, 9 Dec 2018 10:18:23 +0100 Subject: [PATCH] Fix #8392: prevent crash due to inconsistent player list updating. (#8397) --- src/openrct2/Game.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/openrct2/Game.cpp b/src/openrct2/Game.cpp index 3b1a082237..22754f4cd6 100644 --- a/src/openrct2/Game.cpp +++ b/src/openrct2/Game.cpp @@ -540,8 +540,13 @@ int32_t game_do_command_p( void game_log_multiplayer_command(int command, const int* eax, const int* ebx, const int* ecx, int* edx, int* edi, int* ebp) { // Get player name + const char* player_name = "localhost"; + int player_index = network_get_player_index(game_command_playerid); - const char* player_name = network_get_player_name(player_index); + if (player_index != -1) + { + player_name = network_get_player_name(player_index); + } char log_msg[256]; if (command == GAME_COMMAND_CHEAT)