mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 03:44:02 +02:00
back out off-brand change
This commit is contained in:
parent
40a25f859a
commit
f5bc58f606
2 changed files with 8 additions and 3 deletions
|
@ -959,6 +959,9 @@ void EntityTree::fixupMissingParents() {
|
|||
iter.remove();
|
||||
entity->markAncestorMissing(false);
|
||||
}
|
||||
} else {
|
||||
// entity was deleted before we found its parent.
|
||||
iter.remove();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue