Feature #986: Automatic save when losing connection to a network game

This commit is contained in:
Niels Martin Hansen
2018-05-24 19:40:54 +02:00
committed by Michael Lutz
parent 11ba094582
commit 4fb76db42f
4 changed files with 30 additions and 0 deletions

View File

@@ -45,6 +45,8 @@ NetworkRecvStatus NetworkGameSocketHandler::CloseConnection(bool error)
{
/* Clients drop back to the main menu */
if (!_network_server && _networking) {
extern void ClientNetworkEmergencySave(); // from network_client.cpp
ClientNetworkEmergencySave();
_switch_mode = SM_MENU;
_networking = false;
ShowErrorMessage(STR_NETWORK_ERROR_LOSTCONNECTION, INVALID_STRING_ID, WL_CRITICAL);