Destroy entities removed from the NPC

This commit is contained in:
Chris Robinson 2012-07-17 22:47:56 -07:00
parent a32740cf5e
commit 4109d0d923

View file

@ -405,8 +405,12 @@ void NpcAnimation::runAnimation(float timepassed)
void NpcAnimation::removeEntities(std::vector<Ogre::Entity*> &entities) void NpcAnimation::removeEntities(std::vector<Ogre::Entity*> &entities)
{ {
Ogre::SceneManager *sceneMgr = mInsert->getCreator();
for(size_t i = 0;i < entities.size();i++) for(size_t i = 0;i < entities.size();i++)
{
mEntityList.mSkelBase->detachObjectFromBone(entities[i]); mEntityList.mSkelBase->detachObjectFromBone(entities[i]);
sceneMgr->destroyEntity(entities[i]);
}
entities.clear(); entities.clear();
} }