Merge pull request #10478 from sethalves/delete-localtree-children

clean up children of deleted avatar-entity
This commit is contained in:
Brad Hefta-Gaub 2017-05-16 18:14:45 -07:00 committed by GitHub
commit f623a9dc82

View file

@ -452,6 +452,13 @@ void EntityTree::deleteEntity(const EntityItemID& entityID, bool force, bool ign
// NOTE: callers must lock the tree before using this method
DeleteEntityOperator theOperator(getThisPointer(), entityID);
existingEntity->forEachDescendant([&](SpatiallyNestablePointer descendant) {
auto descendantID = descendant->getID();
theOperator.addEntityIDToDeleteList(descendantID);
emit deletingEntity(descendantID);
});
recurseTreeWithOperator(&theOperator);
processRemovedEntities(theOperator);
_isDirty = true;