fixing asserts for EntityItem delete pipeline

This commit is contained in:
Andrew Meadows 2016-01-04 12:02:11 -08:00
parent e0ec941476
commit 4f29156da1
3 changed files with 5 additions and 6 deletions

View file

@ -85,7 +85,6 @@ EntityItem::EntityItem(const EntityItemID& entityItemID) :
}
EntityItem::~EntityItem() {
assert(isDead()); // mark as dead before calling dtor
// clear out any left-over actions
EntityTreePointer entityTree = _element ? _element->getTree() : nullptr;
EntitySimulation* simulation = entityTree ? entityTree->getSimulation() : nullptr;

View file

@ -59,11 +59,12 @@ void EntitySimulation::removeEntityInternal(EntityItemPointer entity) {
void EntitySimulation::prepareEntityForDelete(EntityItemPointer entity) {
assert(entity);
assert(entity->isSimulated());
assert(entity->isDead());
entity->clearActions(this);
removeEntityInternal(entity);
_entitiesToDelete.insert(entity);
if (entity->isSimulated()) {
entity->clearActions(this);
removeEntityInternal(entity);
_entitiesToDelete.insert(entity);
}
}
void EntitySimulation::addEntityInternal(EntityItemPointer entity) {

View file

@ -150,7 +150,6 @@ void PhysicalEntitySimulation::clearEntitiesInternal() {
// virtual
void PhysicalEntitySimulation::prepareEntityForDelete(EntityItemPointer entity) {
assert(entity);
assert(entity->isSimulated());
assert(entity->isDead());
entity->clearActions(this);
removeEntityInternal(entity);