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:
Martin Černáč 2016-02-02 11:08:42 +01:00
parent 7e21ef7ca4
commit 5d69eda3da
1 changed files with 6 additions and 0 deletions

View File

@ -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)
{