summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-12-14 04:08:52 +0300
committerAndrei Karas <akaras@inbox.ru>2011-12-14 04:08:52 +0300
commit6669764210df9526471d22101514e40cd118fee6 (patch)
treed7dae109061189892aa9d64a8c1424ec9067b622 /src
parentc3c14c092bf1038d766dd969561a83515554d844 (diff)
downloadmv-6669764210df9526471d22101514e40cd118fee6.tar.gz
mv-6669764210df9526471d22101514e40cd118fee6.tar.bz2
mv-6669764210df9526471d22101514e40cd118fee6.tar.xz
mv-6669764210df9526471d22101514e40cd118fee6.zip
Fix increasing log file if client was disconnected from network.
Diffstat (limited to 'src')
-rw-r--r--src/game.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/game.cpp b/src/game.cpp
index 2937d6bb7..c7c50dd9c 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -551,9 +551,9 @@ void Game::logic()
if (Client::getState() != STATE_ERROR)
{
- errorMessage = _("The connection to the server was lost.");
if (!disconnectedDialog)
{
+ errorMessage = _("The connection to the server was lost.");
disconnectedDialog = new OkDialog(_("Network Error"),
errorMessage, false);
disconnectedDialog->addActionListener(&errorListener);
@@ -561,14 +561,19 @@ void Game::logic()
}
}
- if (viewport)
+ if (viewport && !errorMessage.empty())
{
Map *map = viewport->getCurrentMap();
if (map)
+ {
+ logger->log("state: %d", Client::getState());
map->saveExtraLayer();
+ }
}
closeDialogs();
Client::setFramerate(config.getIntValue("fpslimit"));
+ if (Client::getState() != STATE_ERROR)
+ errorMessage = "";
}
else
{