don't hang loop if entity isDead

This commit is contained in:
Seth Alves 2017-03-24 11:16:54 -07:00
parent 1972b140b9
commit e1e51614d9

View file

@ -208,6 +208,7 @@ void PhysicalEntitySimulation::getObjectsToAddToPhysics(VectorOfMotionStates& re
assert(!entity->getPhysicsInfo());
if (entity->isDead()) {
prepareEntityForDelete(entity);
entityItr = _entitiesToAddToPhysics.erase(entityItr);
} else if (!entity->shouldBePhysical()) {
// this entity should no longer be on the internal _entitiesToAddToPhysics
entityItr = _entitiesToAddToPhysics.erase(entityItr);