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/actorspritemanager.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/actorspritemanager.h') diff --git a/src/actorspritemanager.h b/src/actorspritemanager.h index 8ff9ff39..76364ea5 100644 --- a/src/actorspritemanager.h +++ b/src/actorspritemanager.h @@ -66,11 +66,16 @@ class ActorSpriteManager */ FloorItem *createItem(int id, int itemId, const Vector &position); + /** + * Immediately destroys the given \a actor. + */ + void destroyActor(ActorSprite *actor); + /** * Destroys the given ActorSprite at the end of * ActorSpriteManager::logic. */ - void destroy(ActorSprite *actor); + void scheduleDelete(ActorSprite *actor); /** * Returns a specific Being, by id; -- cgit v1.2.3-70-g09d2