mirror of
https://github.com/lubosz/overte.git
synced 2025-04-24 09:23:17 +02:00
when a parent entity is deleted, delete its children in the local tree, rather than waiting for the server to tell us about it
This commit is contained in:
parent
9a4b624029
commit
1e4e2cc1b4
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