From d6f47f1f46c4e0e507a15a1f81903db901c0f4b5 Mon Sep 17 00:00:00 2001 From: Stefan Dombrowski Date: Tue, 7 Sep 2010 22:12:46 +0200 Subject: 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 --- src/game.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/game.cpp') 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) { -- cgit v1.2.3-70-g09d2