diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-06-19 21:57:59 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-06-19 21:57:59 +0300 |
commit | 5d8285ae8d16b40cf842f2bafd41978e316ac9b8 (patch) | |
tree | ebee8cf1f20694c896ca15977b35b6c4842cea78 /src | |
parent | 53ff5bb23c455f6201f8b747044dddfbbc729700 (diff) | |
download | manaplus-5d8285ae8d16b40cf842f2bafd41978e316ac9b8.tar.gz manaplus-5d8285ae8d16b40cf842f2bafd41978e316ac9b8.tar.bz2 manaplus-5d8285ae8d16b40cf842f2bafd41978e316ac9b8.tar.xz manaplus-5d8285ae8d16b40cf842f2bafd41978e316ac9b8.zip |
Auto close death dialog if local player resurrected.
Diffstat (limited to 'src')
-rw-r--r-- | src/net/eathena/beingrecv.cpp | 11 | ||||
-rw-r--r-- | src/net/tmwa/beingrecv.cpp | 11 |
2 files changed, 20 insertions, 2 deletions
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") diff --git a/src/net/tmwa/beingrecv.cpp b/src/net/tmwa/beingrecv.cpp index cb02e690e..d9e058955 100644 --- a/src/net/tmwa/beingrecv.cpp +++ b/src/net/tmwa/beingrecv.cpp @@ -33,6 +33,7 @@ #include "input/keyboardconfig.h" +#include "gui/windows/okdialog.h" #include "gui/windows/outfitwindow.h" #include "gui/windows/socialwindow.h" @@ -55,6 +56,8 @@ #include "debug.h" +extern OkDialog *deathNotice; + namespace TmwAthena { @@ -1253,7 +1256,7 @@ void BeingRecv::processPlayerStatusChange(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; @@ -1274,6 +1277,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; + } if (msg.readInt16("flag?") == 1) dstBeing->setAction(BeingAction::STAND, 0); |