mirror of
https://github.com/lubosz/overte.git
synced 2025-04-16 06:16:18 +02:00
fixing asserts for EntityItem delete pipeline
This commit is contained in:
parent
e0ec941476
commit
4f29156da1
3 changed files with 5 additions and 6 deletions
|
@ -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;
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue