mirror of
https://github.com/overte-org/overte.git
synced 2025-04-22 17:53:32 +02:00
Merge pull request #10478 from sethalves/delete-localtree-children
clean up children of deleted avatar-entity
This commit is contained in:
commit
f623a9dc82
1 changed files with 7 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue