mirror of
https://github.com/overte-org/overte.git
synced 2025-04-19 16:23:39 +02:00
sigh... protect againt null MotionStates
This commit is contained in:
parent
fed03edde3
commit
ac60917b54
1 changed files with 7 additions and 6 deletions
|
@ -167,12 +167,13 @@ void PhysicalEntitySimulation::getObjectsToRemoveFromPhysics(VectorOfMotionState
|
|||
_entitiesToAddToPhysics.remove(entity);
|
||||
|
||||
EntityMotionState* motionState = static_cast<EntityMotionState*>(entity->getPhysicsInfo());
|
||||
assert(motionState);
|
||||
_pendingChanges.remove(motionState);
|
||||
_outgoingChanges.remove(motionState);
|
||||
_physicalObjects.remove(motionState);
|
||||
result.push_back(motionState);
|
||||
_entitiesToRelease.insert(entity);
|
||||
if (motionState) {
|
||||
_pendingChanges.remove(motionState);
|
||||
_outgoingChanges.remove(motionState);
|
||||
_physicalObjects.remove(motionState);
|
||||
result.push_back(motionState);
|
||||
_entitiesToRelease.insert(entity);
|
||||
}
|
||||
|
||||
if (entity->isSimulated() && entity->isDead()) {
|
||||
_entitiesToDelete.insert(entity);
|
||||
|
|
Loading…
Reference in a new issue