mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 18:23:54 +02:00
Merge pull request #6635 from sethalves/fix-flashlight-crash
don't crash when a child no longer has a containing element
This commit is contained in:
commit
f61ce98527
1 changed files with 8 additions and 1 deletions
|
@ -226,9 +226,16 @@ bool EntityTree::updateEntityWithElement(EntityItemPointer entity, const EntityI
|
|||
|
||||
while (!toProcess.empty()) {
|
||||
EntityItemPointer childEntity = std::static_pointer_cast<EntityItem>(toProcess.dequeue());
|
||||
if (!childEntity) {
|
||||
continue;
|
||||
}
|
||||
BoundingBoxRelatedProperties newChildBBRelProperties(childEntity);
|
||||
EntityTreeElementPointer containingElement = childEntity->getElement();
|
||||
if (!containingElement) {
|
||||
continue;
|
||||
}
|
||||
UpdateEntityOperator theChildOperator(getThisPointer(),
|
||||
childEntity->getElement(),
|
||||
containingElement,
|
||||
childEntity, newChildBBRelProperties);
|
||||
recurseTreeWithOperator(&theChildOperator);
|
||||
foreach (SpatiallyNestablePointer childChild, childEntity->getChildren()) {
|
||||
|
|
Loading…
Reference in a new issue