summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-01-14 22:57:46 +0300
committerAndrei Karas <akaras@inbox.ru>2015-01-14 22:57:46 +0300
commit0d8db34a591f4dd32e391076991887292b520be4 (patch)
tree45cbd7a00d9c169c0c9d5ed6251f572afbcbad84 /src/gui
parent2a9042761c823c112b6c86af16fb03eef05ce110 (diff)
downloadmanaverse-0d8db34a591f4dd32e391076991887292b520be4.tar.gz
manaverse-0d8db34a591f4dd32e391076991887292b520be4.tar.bz2
manaverse-0d8db34a591f4dd32e391076991887292b520be4.tar.xz
manaverse-0d8db34a591f4dd32e391076991887292b520be4.zip
Prevent from show multiply death dialogs.
This can happend if server update player health in wrong way.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/dialogsmanager.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/gui/dialogsmanager.cpp b/src/gui/dialogsmanager.cpp
index cb3e065bd..1f5a95c1b 100644
--- a/src/gui/dialogsmanager.cpp
+++ b/src/gui/dialogsmanager.cpp
@@ -121,15 +121,17 @@ Window *DialogsManager::openErrorDialog(const std::string &header,
void DialogsManager::playerDeath()
{
- logger->log("DialogsManager::playerDeath");
- // TRANSLATORS: message header
- deathNotice = new OkDialog(_("Message"),
- DeadDB::getRandomString(),
- // TRANSLATORS: ok dialog button
- _("Revive"),
- DialogType::OK,
- false, true, nullptr, 260);
- deathNotice->addActionListener(&postDeathListener);
+ if (!deathNotice)
+ {
+ // TRANSLATORS: message header
+ deathNotice = new OkDialog(_("Message"),
+ DeadDB::getRandomString(),
+ // TRANSLATORS: ok dialog button
+ _("Revive"),
+ DialogType::OK,
+ false, true, nullptr, 260);
+ deathNotice->addActionListener(&postDeathListener);
+ }
}
void DialogsManager::attributeChanged(const int id,