From 7fa9db23c67c690f8d96d5bd1ea2d0c39f52a0ac Mon Sep 17 00:00:00 2001 From: Thorbjørn Lindeijer Date: Thu, 2 May 2013 22:10:21 +0200 Subject: Fixed network layer doing delayed actor deletion The delayed actor deletion was meant to be used during the logic calls, to avoid modifying the container while it is being iterated. The deletions happening from the network layer are not done while iterating the set of actors, so it can delete immediately. This fixes an issue where an NPC would disappear when changing appearance on tmwAthena, because this was implemented as a remove + add, which broke due to the delayed deletion. Mantis-issue: 507 Reviewed-by: Jared Adams --- src/net/manaserv/beinghandler.cpp | 2 +- src/net/manaserv/itemhandler.cpp | 2 +- src/net/tmwa/beinghandler.cpp | 2 +- src/net/tmwa/itemhandler.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/net') diff --git a/src/net/manaserv/beinghandler.cpp b/src/net/manaserv/beinghandler.cpp index 52f6dab4..61b4ef81 100644 --- a/src/net/manaserv/beinghandler.cpp +++ b/src/net/manaserv/beinghandler.cpp @@ -176,7 +176,7 @@ void BeingHandler::handleBeingLeaveMessage(MessageIn &msg) if (!being) return; - actorSpriteManager->destroy(being); + actorSpriteManager->destroyActor(being); } void BeingHandler::handleBeingsMoveMessage(MessageIn &msg) diff --git a/src/net/manaserv/itemhandler.cpp b/src/net/manaserv/itemhandler.cpp index 4e29bb4f..de5b36fa 100644 --- a/src/net/manaserv/itemhandler.cpp +++ b/src/net/manaserv/itemhandler.cpp @@ -60,7 +60,7 @@ void ItemHandler::handleMessage(MessageIn &msg) } else if (FloorItem *item = actorSpriteManager->findItem(id)) { - actorSpriteManager->destroy(item); + actorSpriteManager->destroyActor(item); } } } break; diff --git a/src/net/tmwa/beinghandler.cpp b/src/net/tmwa/beinghandler.cpp index fb01990a..12c97feb 100644 --- a/src/net/tmwa/beinghandler.cpp +++ b/src/net/tmwa/beinghandler.cpp @@ -327,7 +327,7 @@ void BeingHandler::handleMessage(MessageIn &msg) if (msg.readInt8() == 1) dstBeing->setAction(Being::DEAD); else - actorSpriteManager->destroy(dstBeing); + actorSpriteManager->destroyActor(dstBeing); break; diff --git a/src/net/tmwa/itemhandler.cpp b/src/net/tmwa/itemhandler.cpp index f05bb899..6ad0ad4c 100644 --- a/src/net/tmwa/itemhandler.cpp +++ b/src/net/tmwa/itemhandler.cpp @@ -67,7 +67,7 @@ void ItemHandler::handleMessage(MessageIn &msg) case SMSG_ITEM_REMOVE: if (FloorItem *item = actorSpriteManager->findItem(msg.readInt32())) - actorSpriteManager->destroy(item); + actorSpriteManager->destroyActor(item); break; } } -- cgit v1.2.3-70-g09d2