diff options
Diffstat (limited to 'src/beingmanager.cpp')
-rw-r--r-- | src/beingmanager.cpp | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/beingmanager.cpp b/src/beingmanager.cpp index 3b73d29f..273436bf 100644 --- a/src/beingmanager.cpp +++ b/src/beingmanager.cpp @@ -96,10 +96,7 @@ Being* BeingManager::createBeing(Uint32 id, Uint16 job) void BeingManager::destroyBeing(Being *being) { mBeings.remove(being); - if (being == current_npc) - current_npc->handleDeath(); - else - delete being; + delete being; } Being* BeingManager::findBeing(Uint32 id) @@ -196,12 +193,6 @@ void BeingManager::clear() mBeings.remove(player_node); } - if (current_npc) - { - mBeings.remove(current_npc); - current_npc->handleDeath(); - } - delete_all(mBeings); mBeings.clear(); @@ -264,3 +255,13 @@ Being* BeingManager::findNearestLivingBeing(Being *aroundBeing, int maxdist, return (maxdist >= dist) ? closestBeing : NULL; } + +bool BeingManager::hasBeing(Being *being) +{ + for (BeingIterator i = mBeings.begin(); i != mBeings.end(); i++) + { + if (being == *i) return true; + } + + return false; +} |