don't do auto-release test unless the hand is equipping

This commit is contained in:
Seth Alves 2016-09-01 09:57:46 -07:00
parent 2b2d320659
commit 53ba190ca6
3 changed files with 4 additions and 5 deletions

View file

@ -556,14 +556,13 @@ ModelPointer EntityTreeRenderer::allocateModel(const QString& url, float loading
return model;
}
ModelPointer EntityTreeRenderer::updateModel(ModelPointer model, const QString& newUrl, const QString& collisionUrl) {
ModelPointer EntityTreeRenderer::updateModel(ModelPointer model, const QString& newUrl) {
// Only create and delete models on the thread that owns the EntityTreeRenderer
if (QThread::currentThread() != thread()) {
QMetaObject::invokeMethod(this, "updateModel", Qt::BlockingQueuedConnection,
Q_RETURN_ARG(ModelPointer, model),
Q_ARG(ModelPointer, model),
Q_ARG(const QString&, newUrl),
Q_ARG(const QString&, collisionUrl));
Q_ARG(const QString&, newUrl));
return model;
}

View file

@ -76,7 +76,7 @@ public:
Q_INVOKABLE ModelPointer allocateModel(const QString& url, float loadingPriority = 0.0f);
/// if a renderable entity item needs to update the URL of a model, we will handle that for the entity
Q_INVOKABLE ModelPointer updateModel(ModelPointer original, const QString& newUrl, const QString& collisionUrl);
Q_INVOKABLE ModelPointer updateModel(ModelPointer original, const QString& newUrl);
/// if a renderable entity item is done with a model, it should return it to us
void releaseModel(ModelPointer model);

View file

@ -2051,7 +2051,7 @@ function MyController(hand) {
}
var now = Date.now();
if (now - this.lastUnequipCheckTime > MSECS_PER_SEC * CHECK_TOO_FAR_UNEQUIP_TIME) {
if (this.state == STATE_HOLD && now - this.lastUnequipCheckTime > MSECS_PER_SEC * CHECK_TOO_FAR_UNEQUIP_TIME) {
this.lastUnequipCheckTime = now;
if (props.parentID == MyAvatar.sessionUUID) {