From aa1e813d72000e93930cc0ca99cdbc056ada1728 Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Tue, 29 Nov 2016 14:31:29 -0800 Subject: [PATCH] Fix 'releaseGrab' not being called when using grip buttons --- scripts/system/controllers/handControllerGrab.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/system/controllers/handControllerGrab.js b/scripts/system/controllers/handControllerGrab.js index 1ffa993d01..341d8aec18 100644 --- a/scripts/system/controllers/handControllerGrab.js +++ b/scripts/system/controllers/handControllerGrab.js @@ -2047,8 +2047,6 @@ function MyController(hand) { } if (dropDetected && !this.waitForTriggerRelease && this.triggerSmoothedGrab()) { - this.callEntityMethodOnGrabbed("releaseEquip"); - // store the offset attach points into preferences. if (USE_ATTACH_POINT_SETTINGS && this.grabbedHotspot && this.grabbedEntity) { var prefprops = Entities.getEntityProperties(this.grabbedEntity, ["localPosition", "localRotation"]); @@ -2344,6 +2342,9 @@ function MyController(hand) { var noVelocity = false; if (this.grabbedEntity !== null) { + if (this.state === STATE_HOLD) { + this.callEntityMethodOnGrabbed("releaseEquip"); + } // Make a small release haptic pulse if we really were holding something Controller.triggerHapticPulse(HAPTIC_PULSE_STRENGTH, HAPTIC_PULSE_DURATION, this.hand);