From 5d8285ae8d16b40cf842f2bafd41978e316ac9b8 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 19 Jun 2017 21:57:59 +0300 Subject: Auto close death dialog if local player resurrected. --- src/net/eathena/beingrecv.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/net/eathena/beingrecv.cpp') diff --git a/src/net/eathena/beingrecv.cpp b/src/net/eathena/beingrecv.cpp index 41fe73f39..d906ce835 100644 --- a/src/net/eathena/beingrecv.cpp +++ b/src/net/eathena/beingrecv.cpp @@ -42,6 +42,7 @@ #include "gui/windows/skilldialog.h" #include "gui/windows/socialwindow.h" +#include "gui/windows/okdialog.h" #include "gui/windows/outfitwindow.h" #include "net/character.h" @@ -66,6 +67,7 @@ #include "debug.h" extern int serverVersion; +extern OkDialog *deathNotice; namespace EAthena { @@ -1561,7 +1563,8 @@ void BeingRecv::processPlayerStatusChange2(Net::MessageIn &msg) void BeingRecv::processBeingResurrect(Net::MessageIn &msg) { BLOCK_START("BeingRecv::processBeingResurrect") - if ((actorManager == nullptr) || (localPlayer == nullptr)) + if (actorManager == nullptr || + localPlayer == nullptr) { BLOCK_END("BeingRecv::processBeingResurrect") return; @@ -1582,6 +1585,12 @@ void BeingRecv::processBeingResurrect(Net::MessageIn &msg) // If this is player's current target, clear it. if (dstBeing == localPlayer->getTarget()) localPlayer->stopAttack(); + if (dstBeing == localPlayer && + deathNotice != nullptr) + { + deathNotice->scheduleDelete(); + deathNotice = nullptr; + } dstBeing->setAction(BeingAction::STAND, 0); BLOCK_END("BeingRecv::processBeingResurrect") -- cgit v1.2.3-70-g09d2