From 408f65100be61ec3eae0e651b61a1217f778b12f Mon Sep 17 00:00:00 2001 From: "Anthony J. Thibault" Date: Mon, 20 Jun 2016 13:34:05 -0700 Subject: [PATCH] Bug fix for dropping near-grabbed entities via thump press. --- scripts/system/controllers/handControllerGrab.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/scripts/system/controllers/handControllerGrab.js b/scripts/system/controllers/handControllerGrab.js index 4143cdd403..4300c32171 100644 --- a/scripts/system/controllers/handControllerGrab.js +++ b/scripts/system/controllers/handControllerGrab.js @@ -1697,10 +1697,18 @@ function MyController(hand) { return; } - if ((this.state == STATE_HOLD && dropDetected && this.triggerSmoothedGrab()) || this.thumbPressed()) { - this.setState(STATE_OFF, "drop detected"); - this.callEntityMethodOnGrabbed("releaseEquip"); - return; + if (this.state == STATE_HOLD) { + if (dropDetected && this.triggerSmoothedGrab()) { + this.setState(STATE_OFF, "drop gesture detected"); + this.callEntityMethodOnGrabbed("releaseEquip"); + return; + } + + if (this.thumbPressed()) { + this.setState(STATE_OFF, "drop via thumb press"); + this.callEntityMethodOnGrabbed("releaseEquip"); + return; + } } this.heartBeat(this.grabbedEntity);