summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStefan Dombrowski <stefan@uni-bonn.de>2010-09-07 22:12:46 +0200
committerStefan Dombrowski <stefan@uni-bonn.de>2010-09-07 22:12:46 +0200
commitd6f47f1f46c4e0e507a15a1f81903db901c0f4b5 (patch)
treeb86d8ad7e9f655a5b7c127265080a3a5ae9db4fe /src
parent6c98fc5c74fce6cf2135d9add874717434d4ac12 (diff)
downloadmana-d6f47f1f46c4e0e507a15a1f81903db901c0f4b5.tar.gz
mana-d6f47f1f46c4e0e507a15a1f81903db901c0f4b5.tar.bz2
mana-d6f47f1f46c4e0e507a15a1f81903db901c0f4b5.tar.xz
mana-d6f47f1f46c4e0e507a15a1f81903db901c0f4b5.zip
Fixing reconnection after lost connection
An orderly disconnect of the map-server does work fine. Then in Game::logic() an OkDialog is created, which triggers an event that set the state to STATE_CHOOSE_SERVER. Upon an unexpected disconnect the same OkDialog is created, but the player does not see it. That is because the state gets changed to STATE_ERROR, which creates another OkDialog. It changes the state to STATE_CHOOSE_SERVER as well, but the ServerDialog does not take any input. Reviewed-by: Jaxad0127
Diffstat (limited to 'src')
-rw-r--r--src/game.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/game.cpp b/src/game.cpp
index eb666fa9..026b0017 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -347,10 +347,10 @@ void Game::logic()
if (Client::getState() == STATE_CHANGE_MAP)
return; // Not a problem here
- if (Client::getState() != STATE_ERROR)
- {
- errorMessage = _("The connection to the server was lost.");
- }
+ if (Client::getState() == STATE_ERROR)
+ return; // Disconnect gets handled by STATE_ERROR
+
+ errorMessage = _("The connection to the server was lost.");
if (!disconnectedDialog)
{