mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-24 00:03:11 +01:00
Fix segfault when loading network game with unknown objects
This oneliner causes the game not to crash, when connecting to a network game that utilizes objects, that the connecting client doesn't have installed. Instead, it quits to the main menu with an error message being displayed.
This commit is contained in:
@@ -1716,6 +1716,12 @@ void Network::Client_Handle_MAP(NetworkConnection& connection, NetworkPacket& pa
|
||||
// window_network_status_open("Loaded new map from network");
|
||||
_desynchronised = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
//Something went wrong, game is not loaded. Return to main screen.
|
||||
game_do_command(0, GAME_COMMAND_FLAG_APPLY, 0, 0, GAME_COMMAND_LOAD_OR_QUIT, 1, 0);
|
||||
}
|
||||
|
||||
SDL_RWclose(rw);
|
||||
if (has_to_free)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user