summaryrefslogtreecommitdiff
path: root/src
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
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')
-rw-r--r--src/game.cpp6
-rw-r--r--src/game.h2
2 files changed, 5 insertions, 3 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;
}
}
diff --git a/src/game.h b/src/game.h
index 239eb2aa..b2fae121 100644
--- a/src/game.h
+++ b/src/game.h
@@ -68,8 +68,8 @@ class Game
const std::string &getCurrentMapName() { return mMapName; }
private:
-
int mLastTarget;
+ bool mDisconnected;
WindowMenu *mWindowMenu;