diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-11-05 18:14:11 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-11-05 18:14:11 +0300 |
commit | d5d38cf61d5e8664eb3a1b48863bf8a835e7f28c (patch) | |
tree | cce46d04b687551c8e7f4c88f37156fdcc24e8f2 /src/game.cpp | |
parent | df6fb81185bdc4f3ec0dc6cca4fff302d2719b26 (diff) | |
download | manaverse-d5d38cf61d5e8664eb3a1b48863bf8a835e7f28c.tar.gz manaverse-d5d38cf61d5e8664eb3a1b48863bf8a835e7f28c.tar.bz2 manaverse-d5d38cf61d5e8664eb3a1b48863bf8a835e7f28c.tar.xz manaverse-d5d38cf61d5e8664eb3a1b48863bf8a835e7f28c.zip |
Fix double network error dialog.
Diffstat (limited to 'src/game.cpp')
-rw-r--r-- | src/game.cpp | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/src/game.cpp b/src/game.cpp index 14e6806ce..a9fa318f7 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -557,28 +557,25 @@ void Game::logic() return; // Not a problem here if (Client::getState() != STATE_ERROR) - errorMessage = _("The connection to the server was lost."); - - if (!disconnectedDialog) { - if (viewport) - { - Map *map = viewport->getCurrentMap(); - if (map) - map->saveExtraLayer(); - } - closeDialogs(); - Client::setFramerate(config.getIntValue("fpslimit")); - if (logger) + errorMessage = _("The connection to the server was lost."); + if (!disconnectedDialog) { - logger->log("Show error message on state: %d", - Client::getState()); + disconnectedDialog = new OkDialog(_("Network Error"), + errorMessage, false); + disconnectedDialog->addActionListener(&errorListener); + disconnectedDialog->requestMoveToTop(); } - disconnectedDialog = new OkDialog(_("Network Error"), - errorMessage, false); - disconnectedDialog->addActionListener(&errorListener); - disconnectedDialog->requestMoveToTop(); } + + if (viewport) + { + Map *map = viewport->getCurrentMap(); + if (map) + map->saveExtraLayer(); + } + closeDialogs(); + Client::setFramerate(config.getIntValue("fpslimit")); } else { |