From 110f5e9e2adaab0353cc8f3df3ecb01b5aacfe78 Mon Sep 17 00:00:00 2001 From: howard-stearns Date: Wed, 6 Jul 2016 15:08:57 -0700 Subject: [PATCH] Don't compare distance when no intersection. --- scripts/system/controllers/handControllerGrab.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/system/controllers/handControllerGrab.js b/scripts/system/controllers/handControllerGrab.js index dc6b78de8e..373f203e80 100644 --- a/scripts/system/controllers/handControllerGrab.js +++ b/scripts/system/controllers/handControllerGrab.js @@ -224,7 +224,7 @@ function entityHasActions(entityID) { function findRayIntersection(pickRay, precise, include, exclude) { var entities = Entities.findRayIntersection(pickRay, precise, include, exclude); var overlays = Overlays.findRayIntersection(pickRay); - if (!overlays.intersects || (entities.distance <= overlays.distance)) { + if (!overlays.intersects || (entities.intersects && (entities.distance <= overlays.distance))) { return entities; } return overlays;