From e7e4d80be5132100a471678fd9695738be1ce4e4 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Thu, 7 May 2015 15:22:58 -0700 Subject: [PATCH] always remove from _pendingAdds just in case --- libraries/physics/src/PhysicalEntitySimulation.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/libraries/physics/src/PhysicalEntitySimulation.cpp b/libraries/physics/src/PhysicalEntitySimulation.cpp index 06d025244a..ed7b986800 100644 --- a/libraries/physics/src/PhysicalEntitySimulation.cpp +++ b/libraries/physics/src/PhysicalEntitySimulation.cpp @@ -62,15 +62,10 @@ void PhysicalEntitySimulation::removeEntityInternal(EntityItem* entity) { if (motionState) { motionState->clearEntity(); entity->setPhysicsInfo(nullptr); - - // NOTE: we must remove entity from _pendingAdds immediately because we've disconnected the backpointers between - // motionState and entity and they can't be used to look up each other. However we don't need to remove - // motionState from _pendingChanges at this time becuase it will be removed during getObjectsToDelete(). - _pendingAdds.remove(entity); - _pendingRemoves.insert(motionState); _outgoingChanges.remove(motionState); } + _pendingAdds.remove(entity); } void PhysicalEntitySimulation::changeEntityInternal(EntityItem* entity) {