summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-02-02 22:15:55 +0200
committerAndrei Karas <akaras@inbox.ru>2011-02-02 22:15:55 +0200
commit4ead5c9f65ffbf1de9b0cb60cae06b116badbced (patch)
treebc94093b90e7b4d3168259b7404ae2f6236f3925 /src/game.cpp
parent4b0caea6389ab789ff3ae3a267b9002f8a21e8c3 (diff)
downloadplus-4ead5c9f65ffbf1de9b0cb60cae06b116badbced.tar.gz
plus-4ead5c9f65ffbf1de9b0cb60cae06b116badbced.tar.bz2
plus-4ead5c9f65ffbf1de9b0cb60cae06b116badbced.tar.xz
plus-4ead5c9f65ffbf1de9b0cb60cae06b116badbced.zip
Close npc and other dialogs if reconnecting.
Also save extra layers if network error.
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/game.cpp b/src/game.cpp
index f5565b71e..efa5085f5 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -484,12 +484,27 @@ void Game::logic()
if (!disconnectedDialog)
{
+ if (viewport)
+ {
+ Map *map = viewport->getCurrentMap();
+ if (map)
+ map->saveExtraLayer();
+ }
+ Client::closeDialogs();
disconnectedDialog = new OkDialog(_("Network Error"),
errorMessage, false);
disconnectedDialog->addActionListener(&errorListener);
disconnectedDialog->requestMoveToTop();
}
}
+ else
+ {
+ if (disconnectedDialog)
+ {
+ disconnectedDialog->scheduleDelete();
+ disconnectedDialog = 0;
+ }
+ }
}
/**