From d47c74408e332b8784940a202c348d365ef1058d Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Wed, 4 May 2016 15:47:39 -0700 Subject: [PATCH] Cleanup handleViewpoint --- libraries/networking/src/AddressManager.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libraries/networking/src/AddressManager.cpp b/libraries/networking/src/AddressManager.cpp index 8e8ce9c4b0..6ef6726827 100644 --- a/libraries/networking/src/AddressManager.cpp +++ b/libraries/networking/src/AddressManager.cpp @@ -501,6 +501,8 @@ bool AddressManager::handleViewpoint(const QString& viewpointString, bool should QRegExp orientationRegex(QUAT_REGEX_STRING); + bool orientationChanged = false; + // we may also have an orientation if (viewpointString[positionRegex.matchedLength() - 1] == QChar('/') && orientationRegex.indexIn(viewpointString, positionRegex.matchedLength() - 1) != -1) { @@ -512,14 +514,13 @@ bool AddressManager::handleViewpoint(const QString& viewpointString, bool should if (!isNaN(newOrientation.x) && !isNaN(newOrientation.y) && !isNaN(newOrientation.z) && !isNaN(newOrientation.w)) { - emit locationChangeRequired(newPosition, true, newOrientation, shouldFace); - return true; + orientationChanged = true; } else { qCDebug(networking) << "Orientation parsed from lookup string is invalid. Will not use for location change."; } } - emit locationChangeRequired(newPosition, false, newOrientation, shouldFace); + emit locationChangeRequired(newPosition, orientationChanged, newOrientation, shouldFace); } else { qCDebug(networking) << "Could not jump to position from lookup string because it has an invalid value.";