back out off-brand change

This commit is contained in:
Seth Alves 2016-01-03 08:00:31 -08:00
parent 40a25f859a
commit f5bc58f606
2 changed files with 8 additions and 3 deletions

View file

@ -959,6 +959,9 @@ void EntityTree::fixupMissingParents() {
iter.remove();
entity->markAncestorMissing(false);
}
} else {
// entity was deleted before we found its parent.
iter.remove();
}
}

View file

@ -23,15 +23,15 @@ ObjectAction::~ObjectAction() {
}
void ObjectAction::updateAction(btCollisionWorld* collisionWorld, btScalar deltaTimeStep) {
bool ownerEntityExpired = false;
quint64 expiresWhen = 0;
EntityItemPointer ownerEntity = nullptr;
withReadLock([&]{
ownerEntity = _ownerEntity.lock();
ownerEntityExpired = _ownerEntity.expired();
expiresWhen = _expires;
});
if (!ownerEntity) {
if (ownerEntityExpired) {
qDebug() << "warning -- action with no entity removing self from btCollisionWorld.";
btDynamicsWorld* dynamicsWorld = static_cast<btDynamicsWorld*>(collisionWorld);
if (dynamicsWorld) {
@ -43,8 +43,10 @@ void ObjectAction::updateAction(btCollisionWorld* collisionWorld, btScalar delta
if (expiresWhen > 0) {
quint64 now = usecTimestampNow();
if (now > expiresWhen) {
EntityItemPointer ownerEntity = nullptr;
QUuid myID;
withWriteLock([&]{
ownerEntity = _ownerEntity.lock();
_active = false;
myID = getID();
});