From a1a752743acb5ceaf240ba873b992e9b3dcc0a77 Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Fri, 22 Dec 2017 13:57:28 -0800 Subject: [PATCH 1/3] fix issue --- libraries/entities/src/EntityItem.cpp | 35 +++++++++---------- .../dressing_room/.#doppelganger.js | 1 + 2 files changed, 18 insertions(+), 18 deletions(-) create mode 100644 script-archive/dressing_room/.#doppelganger.js diff --git a/libraries/entities/src/EntityItem.cpp b/libraries/entities/src/EntityItem.cpp index 271fef33c8..87dbc23611 100644 --- a/libraries/entities/src/EntityItem.cpp +++ b/libraries/entities/src/EntityItem.cpp @@ -2071,9 +2071,25 @@ bool EntityItem::removeActionInternal(const QUuid& actionID, EntitySimulationPoi } EntityDynamicPointer action = _objectActions[actionID]; - + auto removedActionType = action->getType(); + if ((removedActionType == DYNAMIC_TYPE_HOLD || removedActionType == DYNAMIC_TYPE_FAR_GRAB) && !stillHasGrabActions()) { + _dirtyFlags &= ~Simulation::NO_BOOTSTRAPPING; + _dirtyFlags |= Simulation::DIRTY_COLLISION_GROUP; // may need to not collide with own avatar + forEachDescendant([&](SpatiallyNestablePointer child) { + if (child->getNestableType() == NestableType::Entity) { + EntityItemPointer entity = std::static_pointer_cast(child); + entity->markDirtyFlags(Simulation::DIRTY_COLLISION_GROUP); + entity->clearDirtyFlags(Simulation::NO_BOOTSTRAPPING); + } + }); + } else { + // NO-OP: we assume NO_BOOTSTRAPPING bits and collision group are correct + // because they should have been set correctly when the action was added + // and/or when children were linked + } action->setOwnerEntity(nullptr); action->setIsMine(false); + _objectActions.remove(actionID); if (simulation) { action->removeFromSimulation(simulation); @@ -2082,23 +2098,6 @@ bool EntityItem::removeActionInternal(const QUuid& actionID, EntitySimulationPoi bool success = true; serializeActions(success, _allActionsDataCache); _dirtyFlags |= Simulation::DIRTY_PHYSICS_ACTIVATION; - auto removedActionType = action->getType(); - if ((removedActionType == DYNAMIC_TYPE_HOLD || removedActionType == DYNAMIC_TYPE_FAR_GRAB) && !stillHasGrabActions()) { - _dirtyFlags &= ~Simulation::NO_BOOTSTRAPPING; - _dirtyFlags |= Simulation::DIRTY_COLLISION_GROUP; // may need to not collide with own avatar - forEachDescendant([&](SpatiallyNestablePointer child) { - if (child->getNestableType() == NestableType::Entity) { - EntityItemPointer entity = std::static_pointer_cast(child); - entity->markDirtyFlags(Simulation::DIRTY_COLLISION_GROUP); - entity->clearDirtyFlags(Simulation::NO_BOOTSTRAPPING); - } - }); - } else { - // NO-OP: we assume NO_BOOTSTRAPPING bits and collision group are correct - // because they should have been set correctly when the action was added - // and/or when children were linked - } - _objectActions.remove(actionID); setDynamicDataNeedsTransmit(true); return success; } diff --git a/script-archive/dressing_room/.#doppelganger.js b/script-archive/dressing_room/.#doppelganger.js new file mode 100644 index 0000000000..e212fd31a7 --- /dev/null +++ b/script-archive/dressing_room/.#doppelganger.js @@ -0,0 +1 @@ +dante@0228-DESKTOP-PC.36668:1512668335 \ No newline at end of file From d74f7f846cbad243b9dd6bf83bee6997599a1abe Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Fri, 22 Dec 2017 13:58:42 -0800 Subject: [PATCH 2/3] delete dot file --- script-archive/dressing_room/.#doppelganger.js | 1 - 1 file changed, 1 deletion(-) delete mode 100644 script-archive/dressing_room/.#doppelganger.js diff --git a/script-archive/dressing_room/.#doppelganger.js b/script-archive/dressing_room/.#doppelganger.js deleted file mode 100644 index e212fd31a7..0000000000 --- a/script-archive/dressing_room/.#doppelganger.js +++ /dev/null @@ -1 +0,0 @@ -dante@0228-DESKTOP-PC.36668:1512668335 \ No newline at end of file From fe61d7efc75854b09d5eee3ffd0107abb52f29e1 Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Fri, 22 Dec 2017 14:13:04 -0800 Subject: [PATCH 3/3] fix spacing --- libraries/entities/src/EntityItem.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libraries/entities/src/EntityItem.cpp b/libraries/entities/src/EntityItem.cpp index 87dbc23611..b60220c1bc 100644 --- a/libraries/entities/src/EntityItem.cpp +++ b/libraries/entities/src/EntityItem.cpp @@ -2076,12 +2076,12 @@ bool EntityItem::removeActionInternal(const QUuid& actionID, EntitySimulationPoi _dirtyFlags &= ~Simulation::NO_BOOTSTRAPPING; _dirtyFlags |= Simulation::DIRTY_COLLISION_GROUP; // may need to not collide with own avatar forEachDescendant([&](SpatiallyNestablePointer child) { - if (child->getNestableType() == NestableType::Entity) { - EntityItemPointer entity = std::static_pointer_cast(child); - entity->markDirtyFlags(Simulation::DIRTY_COLLISION_GROUP); - entity->clearDirtyFlags(Simulation::NO_BOOTSTRAPPING); - } - }); + if (child->getNestableType() == NestableType::Entity) { + EntityItemPointer entity = std::static_pointer_cast(child); + entity->markDirtyFlags(Simulation::DIRTY_COLLISION_GROUP); + entity->clearDirtyFlags(Simulation::NO_BOOTSTRAPPING); + } + }); } else { // NO-OP: we assume NO_BOOTSTRAPPING bits and collision group are correct // because they should have been set correctly when the action was added