clean up actions when DeleteEntityOperator's list is processed rather than as it's made

This commit is contained in:
Seth Alves 2015-06-04 09:55:25 -07:00
parent 57d85cece0
commit 9cae11cc3c
2 changed files with 1 additions and 7 deletions

View file

@ -46,13 +46,6 @@ void DeleteEntityOperator::addEntityIDToDeleteList(const EntityItemID& searchEnt
//assert(false);
qCDebug(entities) << "that's UNEXPECTED, we got a _containingElement, but couldn't find the oldEntity!";
} else {
const EntityTree* tree = details.containingElement->getTree();
if (tree) {
EntitySimulation* simulation = tree->getSimulation();
if (simulation) {
details.entity->clearActions(simulation);
}
}
details.cube = details.containingElement->getAACube();
_entitiesToDelete << details;
_lookingCount++;

View file

@ -381,6 +381,7 @@ void EntityTree::processRemovedEntities(const DeleteEntityOperator& theOperator)
}
if (_simulation) {
theEntity->clearActions(_simulation);
_simulation->removeEntity(theEntity);
}
}