History

always remove from _pendingAdds just in case

Andrew Meadows committed 11 years ago

Commit e7e4d801 parent 1879a671 file · +1 −6Browse files

Showing the changes to libraries/physics/src/PhysicalEntitySimulation.cpp (1 of 1 file). Show all

Unified · Split

libraries/physics/src/PhysicalEntitySimulation.cpp+1−6
@@ -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
76void PhysicalEntitySimulation::changeEntityInternal(EntityItem* entity) {71void PhysicalEntitySimulation::changeEntityInternal(EntityItem* entity) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t