summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2011-04-30 23:26:09 +0200
committerThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2011-04-30 23:49:36 +0200
commitad85ee32f90939717c5fac5defcdc20f82eb3922 (patch)
tree66aef3e303a0bece2e626124f97b1ca0b6c2e66e /src/game.cpp
parenta01ad865cd431f919b2d177ccfb035ee6c7c1609 (diff)
downloadmana-ad85ee32f90939717c5fac5defcdc20f82eb3922.tar.gz
mana-ad85ee32f90939717c5fac5defcdc20f82eb3922.tar.bz2
mana-ad85ee32f90939717c5fac5defcdc20f82eb3922.tar.xz
mana-ad85ee32f90939717c5fac5defcdc20f82eb3922.zip
Fixed disconnected dialog to only pop up once
Bug introduced in 88934303761ba950be56eac8b60de2dede88a29f and spotted by Stefan Dombrowski. Reviewed-by: Stefan Dombrowski Reviewed-by: Yohann Ferreira
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/game.cpp b/src/game.cpp
index bcfd9ac2..16ea45d6 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -220,7 +220,8 @@ Game *Game::mInstance = 0;
Game::Game():
mLastTarget(ActorSprite::UNKNOWN),
- mCurrentMap(0), mMapName("")
+ mDisconnected(false),
+ mCurrentMap(0)
{
assert(!mInstance);
mInstance = this;
@@ -374,7 +375,7 @@ void Game::logic()
cur_time = time(NULL);
// Handle network stuff
- if (!Net::getGameHandler()->isConnected())
+ if (!Net::getGameHandler()->isConnected() && !mDisconnected)
{
if (Client::getState() == STATE_CHANGE_MAP)
return; // Not a problem here
@@ -386,6 +387,7 @@ void Game::logic()
Client::instance()->showOkDialog(_("Network Error"),
errorMessage,
STATE_CHOOSE_SERVER);
+ mDisconnected = true;
}
}