summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
Diffstat (limited to 'src/net')
-rw-r--r--src/net/ea/beingrecv.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/net/ea/beingrecv.cpp b/src/net/ea/beingrecv.cpp
index be3cc4cb9..f09979e58 100644
--- a/src/net/ea/beingrecv.cpp
+++ b/src/net/ea/beingrecv.cpp
@@ -64,6 +64,7 @@ void BeingRecv::processBeingRemove(Net::MessageIn &msg)
// A being should be removed or has died
const BeingId id = msg.readBeingId("being id");
+ const uint8_t type = msg.readUInt8("remove flag");
Being *const dstBeing = actorManager->findBeing(id);
if (!dstBeing)
{
@@ -79,7 +80,7 @@ void BeingRecv::processBeingRemove(Net::MessageIn &msg)
if (dstBeing == localPlayer->getTarget())
localPlayer->stopAttack(true);
- if (msg.readUInt8("dead flag?") == 1U)
+ if (type == 1U)
{
if (dstBeing->getCurrentAction() != BeingAction::DEAD)
{
@@ -87,6 +88,12 @@ void BeingRecv::processBeingRemove(Net::MessageIn &msg)
dstBeing->recalcSpritesOrder();
}
}
+ else if (type == 0U && dstBeing->getType() == ActorType::Npc)
+ {
+ const BeingInfo *const info = dstBeing->getInfo();
+ if (!info || info->getAllowDelete())
+ actorManager->destroy(dstBeing);
+ }
else
{
if (dstBeing->getType() == ActorType::Player)