mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 04:12:46 +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() {
|
EntityItem::~EntityItem() {
|
||||||
assert(isDead()); // mark as dead before calling dtor
|
|
||||||
// clear out any left-over actions
|
// clear out any left-over actions
|
||||||
EntityTreePointer entityTree = _element ? _element->getTree() : nullptr;
|
EntityTreePointer entityTree = _element ? _element->getTree() : nullptr;
|
||||||
EntitySimulation* simulation = entityTree ? entityTree->getSimulation() : nullptr;
|
EntitySimulation* simulation = entityTree ? entityTree->getSimulation() : nullptr;
|
||||||
|
|
|
@ -59,11 +59,12 @@ void EntitySimulation::removeEntityInternal(EntityItemPointer entity) {
|
||||||
|
|
||||||
void EntitySimulation::prepareEntityForDelete(EntityItemPointer entity) {
|
void EntitySimulation::prepareEntityForDelete(EntityItemPointer entity) {
|
||||||
assert(entity);
|
assert(entity);
|
||||||
assert(entity->isSimulated());
|
|
||||||
assert(entity->isDead());
|
assert(entity->isDead());
|
||||||
entity->clearActions(this);
|
if (entity->isSimulated()) {
|
||||||
removeEntityInternal(entity);
|
entity->clearActions(this);
|
||||||
_entitiesToDelete.insert(entity);
|
removeEntityInternal(entity);
|
||||||
|
_entitiesToDelete.insert(entity);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void EntitySimulation::addEntityInternal(EntityItemPointer entity) {
|
void EntitySimulation::addEntityInternal(EntityItemPointer entity) {
|
||||||
|
|
|
@ -150,7 +150,6 @@ void PhysicalEntitySimulation::clearEntitiesInternal() {
|
||||||
// virtual
|
// virtual
|
||||||
void PhysicalEntitySimulation::prepareEntityForDelete(EntityItemPointer entity) {
|
void PhysicalEntitySimulation::prepareEntityForDelete(EntityItemPointer entity) {
|
||||||
assert(entity);
|
assert(entity);
|
||||||
assert(entity->isSimulated());
|
|
||||||
assert(entity->isDead());
|
assert(entity->isDead());
|
||||||
entity->clearActions(this);
|
entity->clearActions(this);
|
||||||
removeEntityInternal(entity);
|
removeEntityInternal(entity);
|
||||||
|
|
Loading…
Reference in a new issue