mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 16:36:54 +02:00
trying to track down why equips fail after a few minutes
This commit is contained in:
parent
c84fa5f821
commit
1d9f3097da
1 changed files with 3 additions and 5 deletions
|
@ -23,15 +23,15 @@ ObjectAction::~ObjectAction() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ObjectAction::updateAction(btCollisionWorld* collisionWorld, btScalar deltaTimeStep) {
|
void ObjectAction::updateAction(btCollisionWorld* collisionWorld, btScalar deltaTimeStep) {
|
||||||
bool ownerEntityExpired = false;
|
|
||||||
quint64 expiresWhen = 0;
|
quint64 expiresWhen = 0;
|
||||||
|
EntityItemPointer ownerEntity = nullptr;
|
||||||
|
|
||||||
withReadLock([&]{
|
withReadLock([&]{
|
||||||
ownerEntityExpired = _ownerEntity.expired();
|
ownerEntity = _ownerEntity.lock();
|
||||||
expiresWhen = _expires;
|
expiresWhen = _expires;
|
||||||
});
|
});
|
||||||
|
|
||||||
if (ownerEntityExpired) {
|
if (!ownerEntity) {
|
||||||
qDebug() << "warning -- action with no entity removing self from btCollisionWorld.";
|
qDebug() << "warning -- action with no entity removing self from btCollisionWorld.";
|
||||||
btDynamicsWorld* dynamicsWorld = static_cast<btDynamicsWorld*>(collisionWorld);
|
btDynamicsWorld* dynamicsWorld = static_cast<btDynamicsWorld*>(collisionWorld);
|
||||||
if (dynamicsWorld) {
|
if (dynamicsWorld) {
|
||||||
|
@ -43,10 +43,8 @@ void ObjectAction::updateAction(btCollisionWorld* collisionWorld, btScalar delta
|
||||||
if (expiresWhen > 0) {
|
if (expiresWhen > 0) {
|
||||||
quint64 now = usecTimestampNow();
|
quint64 now = usecTimestampNow();
|
||||||
if (now > expiresWhen) {
|
if (now > expiresWhen) {
|
||||||
EntityItemPointer ownerEntity = nullptr;
|
|
||||||
QUuid myID;
|
QUuid myID;
|
||||||
withWriteLock([&]{
|
withWriteLock([&]{
|
||||||
ownerEntity = _ownerEntity.lock();
|
|
||||||
_active = false;
|
_active = false;
|
||||||
myID = getID();
|
myID = getID();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue