summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/game.cpp12
-rw-r--r--src/game.h2
-rw-r--r--src/gui/quitdialog.cpp6
-rw-r--r--src/net/ea/playerhandler.cpp2
4 files changed, 17 insertions, 5 deletions
diff --git a/src/game.cpp b/src/game.cpp
index a81252b6c..021943822 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -567,7 +567,7 @@ void Game::logic()
if (map)
map->saveExtraLayer();
}
- Client::closeDialogs();
+ closeDialogs();
Client::setFramerate(config.getIntValue("fpslimit"));
if (logger)
{
@@ -1875,3 +1875,13 @@ void Game::clearKeysArray()
mLastKeys[f].cnt = 0;
}
}
+
+void Game::closeDialogs()
+{
+ Client::closeDialogs();
+ if (deathNotice)
+ {
+ deathNotice->scheduleDelete();
+ deathNotice = 0;
+ }
+}
diff --git a/src/game.h b/src/game.h
index 84dca08e9..24ca7f0fc 100644
--- a/src/game.h
+++ b/src/game.h
@@ -96,6 +96,8 @@ class Game
void setAdjustLevel(int n)
{ mAdjustLevel = n; }
+ static void closeDialogs();
+
private:
void updateHistory(SDL_Event &event);
diff --git a/src/gui/quitdialog.cpp b/src/gui/quitdialog.cpp
index 05691c2d2..1307e198f 100644
--- a/src/gui/quitdialog.cpp
+++ b/src/gui/quitdialog.cpp
@@ -133,13 +133,13 @@ void QuitDialog::action(const gcn::ActionEvent &event)
}
else if (mLogoutQuit->isSelected())
{
- Client::closeDialogs();
+ Game::closeDialogs();
Client::setState(STATE_EXIT);
}
else if (Net::getGameHandler()->isConnected()
&& mSwitchAccountServer->isSelected())
{
- Client::closeDialogs();
+ Game::closeDialogs();
Client::setState(STATE_SWITCH_SERVER);
}
else if (mSwitchCharacter->isSelected())
@@ -147,7 +147,7 @@ void QuitDialog::action(const gcn::ActionEvent &event)
if (Client::getState() == STATE_GAME)
{
Net::getCharHandler()->switchCharacter();
- Client::closeDialogs();
+ Game::closeDialogs();
}
}
}
diff --git a/src/net/ea/playerhandler.cpp b/src/net/ea/playerhandler.cpp
index 81e520415..3009426ae 100644
--- a/src/net/ea/playerhandler.cpp
+++ b/src/net/ea/playerhandler.cpp
@@ -74,7 +74,7 @@ namespace
Net::getPlayerHandler()->respawn();
deathNotice = NULL;
- Client::closeDialogs();
+ Game::closeDialogs();
if (viewport)
viewport->closePopupMenu();