From c2d614b88481c6f69bb63ee5254e3a7a5e4d5788 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Fri, 1 May 2015 11:19:01 -0700 Subject: [PATCH] remove _movableButStoppedEntities --- .../entities/src/SimpleEntitySimulation.cpp | 16 ++++------------ libraries/entities/src/SimpleEntitySimulation.h | 1 - 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/libraries/entities/src/SimpleEntitySimulation.cpp b/libraries/entities/src/SimpleEntitySimulation.cpp index b6e444a0a9..e4662638e3 100644 --- a/libraries/entities/src/SimpleEntitySimulation.cpp +++ b/libraries/entities/src/SimpleEntitySimulation.cpp @@ -22,13 +22,12 @@ void SimpleEntitySimulation::updateEntitiesInternal(const quint64& now) { SetOfEntities::iterator itemItr = _movingEntities.begin(); while (itemItr != _movingEntities.end()) { EntityItem* entity = *itemItr; - if (!entity->isMoving()) { - itemItr = _movingEntities.erase(itemItr); - _movableButStoppedEntities.insert(entity); - } else { + if (entity->isMoving()) { entity->simulate(now); _entitiesToSort.insert(entity); ++itemItr; + } else { + itemItr = _movingEntities.erase(itemItr); } } @@ -53,9 +52,7 @@ void SimpleEntitySimulation::updateEntitiesInternal(const quint64& now) { void SimpleEntitySimulation::addEntityInternal(EntityItem* entity) { if (entity->isMoving()) { _movingEntities.insert(entity); - } else if (entity->getCollisionsWillMove()) { - _movableButStoppedEntities.insert(entity); - } + } if (!entity->getSimulatorID().isNull()) { _hasSimulationOwnerEntities.insert(entity); } @@ -63,7 +60,6 @@ void SimpleEntitySimulation::addEntityInternal(EntityItem* entity) { void SimpleEntitySimulation::removeEntityInternal(EntityItem* entity) { _movingEntities.remove(entity); - _movableButStoppedEntities.remove(entity); _hasSimulationOwnerEntities.remove(entity); clearEntitySimulation(entity); } @@ -75,11 +71,8 @@ void SimpleEntitySimulation::changeEntityInternal(EntityItem* entity) { if (dirtyFlags & SIMPLE_SIMULATION_DIRTY_FLAGS) { if (entity->isMoving()) { _movingEntities.insert(entity); - } else if (entity->getCollisionsWillMove()) { - _movableButStoppedEntities.remove(entity); } else { _movingEntities.remove(entity); - _movableButStoppedEntities.remove(entity); } if (!entity->getSimulatorID().isNull()) { _hasSimulationOwnerEntities.insert(entity); @@ -90,7 +83,6 @@ void SimpleEntitySimulation::changeEntityInternal(EntityItem* entity) { void SimpleEntitySimulation::clearEntitiesInternal() { _movingEntities.clear(); - _movableButStoppedEntities.clear(); _hasSimulationOwnerEntities.clear(); } diff --git a/libraries/entities/src/SimpleEntitySimulation.h b/libraries/entities/src/SimpleEntitySimulation.h index b63047ef0e..454d168556 100644 --- a/libraries/entities/src/SimpleEntitySimulation.h +++ b/libraries/entities/src/SimpleEntitySimulation.h @@ -29,7 +29,6 @@ protected: virtual void clearEntitiesInternal(); SetOfEntities _movingEntities; - SetOfEntities _movableButStoppedEntities; SetOfEntities _hasSimulationOwnerEntities; };