summaryrefslogtreecommitdiff
path: root/src/network/core
diff options
context:
space:
mode:
authorNiels Martin Hansen <nielsm@indvikleren.dk>2018-05-24 19:40:54 +0200
committerMichael Lutz <michi@icosahedron.de>2018-06-23 15:22:31 +0200
commit4fb76db42f886ff21a9f60fc89c786de79d79705 (patch)
treee98db0834c6797a1b87a43ccc14479917855c2c3 /src/network/core
parent11ba094582ae3eb8ed20f2f47938e18a827d6163 (diff)
downloadopenttd-4fb76db42f886ff21a9f60fc89c786de79d79705.tar.xz
Feature #986: Automatic save when losing connection to a network game
Diffstat (limited to 'src/network/core')
-rw-r--r--src/network/core/tcp_game.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/network/core/tcp_game.cpp b/src/network/core/tcp_game.cpp
index 9b3f7b5ef..caa378fc4 100644
--- a/src/network/core/tcp_game.cpp
+++ b/src/network/core/tcp_game.cpp
@@ -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);