Showing the changes to libraries/physics/src/PhysicalEntitySimulation.cpp (1 of 1 file). Show all
Unified · Split
| @@ -62,15 +62,10 @@ void PhysicalEntitySimulation::removeEntityInternal(EntityItem* entity) { · 61 unmodified lines | |||
| 62 | if (motionState) { | 62 | if (motionState) { |
| 63 | motionState->clearEntity(); | 63 | motionState->clearEntity(); |
| 64 | entity->setPhysicsInfo(nullptr); | 64 | entity->setPhysicsInfo(nullptr); |
| 65 | |||
| 66 | // NOTE: we must remove entity from _pendingAdds immediately because we've disconnected the backpointers between | ||
| 67 | // motionState and entity and they can't be used to look up each other. However we don't need to remove | ||
| 68 | // motionState from _pendingChanges at this time becuase it will be removed during getObjectsToDelete(). | ||
| 69 | _pendingAdds.remove(entity); | ||
| 70 | |||
| 71 | _pendingRemoves.insert(motionState); | 65 | _pendingRemoves.insert(motionState); |
| 72 | _outgoingChanges.remove(motionState); | 66 | _outgoingChanges.remove(motionState); |
| 73 | } | 67 | } |
| 68 | _pendingAdds.remove(entity); | ||
| 74 | } | 69 | } |
| 75 | 70 | ||
| 76 | void PhysicalEntitySimulation::changeEntityInternal(EntityItem* entity) { | 71 | void PhysicalEntitySimulation::changeEntityInternal(EntityItem* entity) { |