From 858b02f29d71d6091b227c989ee7b70eeb7eafe3 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Thu, 8 Mar 2018 10:11:26 -0800 Subject: [PATCH] more readable code --- libraries/entities/src/EntityTreeElement.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/entities/src/EntityTreeElement.cpp b/libraries/entities/src/EntityTreeElement.cpp index 654d4b4ecc..1ae55bc333 100644 --- a/libraries/entities/src/EntityTreeElement.cpp +++ b/libraries/entities/src/EntityTreeElement.cpp @@ -601,8 +601,8 @@ EntityItemID EntityTreeElement::findRayIntersection(const glm::vec3& origin, con // if the ray doesn't intersect with our cube OR the distance to element is less than current best distance // we can stop searching! - if (!_cube.findRayIntersection(origin, direction, distanceToElementCube, localFace, localSurfaceNormal) - || (!_cube.contains(origin) && distanceToElementCube > distance)) { + bool hit = _cube.findRayIntersection(origin, direction, distanceToElementCube, localFace, localSurfaceNormal); + if (!hit || (!_cube.contains(origin) && distanceToElementCube > distance)) { keepSearching = false; // no point in continuing to search return result; // we did not intersect }