From 4fcccb545559e741f159890882b09b19870c8b5c Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Tue, 20 Dec 2016 14:32:47 -0800 Subject: [PATCH] check for release of equip in this.nearGrabbing --- .../system/controllers/handControllerGrab.js | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/scripts/system/controllers/handControllerGrab.js b/scripts/system/controllers/handControllerGrab.js index 5f42882194..040b083a69 100644 --- a/scripts/system/controllers/handControllerGrab.js +++ b/scripts/system/controllers/handControllerGrab.js @@ -1088,15 +1088,7 @@ function MyController(hand) { }; this.secondaryReleased = function() { - var released = _this.rawSecondaryValue < BUMPER_ON_VALUE; - - if (released) { - // if we were holding something, the release of the - // secondary trigger releases it - _this.release(); - } - - return released; + return _this.rawSecondaryValue < BUMPER_ON_VALUE; }; // this.triggerOrsecondarySqueezed = function () { @@ -2159,6 +2151,13 @@ function MyController(hand) { if (this.state == STATE_HOLD) { + if (this.secondaryReleased()) { + // we have an equipped object and the secondary trigger was released + // short-circuit the other checks and release it + this.release() + return; + } + var dropDetected = this.dropGestureProcess(deltaTime); if (this.triggerSmoothedReleased()) {