From 0d8db34a591f4dd32e391076991887292b520be4 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 14 Jan 2015 22:57:46 +0300 Subject: Prevent from show multiply death dialogs. This can happend if server update player health in wrong way. --- src/gui/dialogsmanager.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'src/gui/dialogsmanager.cpp') 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, -- cgit v1.2.3-60-g2f50