From 90ae1fea8b2aef2bfc1a0d3d288917202e3aa657 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Fri, 10 Jul 2015 11:30:24 -0700 Subject: [PATCH] handle case where action params are missing --- libraries/physics/src/ObjectActionOffset.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/libraries/physics/src/ObjectActionOffset.cpp b/libraries/physics/src/ObjectActionOffset.cpp index 2391ded13d..00b7fe6734 100644 --- a/libraries/physics/src/ObjectActionOffset.cpp +++ b/libraries/physics/src/ObjectActionOffset.cpp @@ -95,26 +95,21 @@ bool ObjectActionOffset::updateArguments(QVariantMap arguments) { glm::vec3 pointToOffsetFrom = EntityActionInterface::extractVec3Argument("offset action", arguments, "pointToOffsetFrom", ok, true); if (!ok) { - return false; + pointToOffsetFrom = _pointToOffsetFrom; } ok = true; float linearTimeScale = EntityActionInterface::extractFloatArgument("offset action", arguments, "linearTimeScale", ok, false); - if (ok) { - if (linearTimeScale <= 0.0f) { - qDebug() << "offset action -- linearTimeScale must be greater than zero."; - return false; - } - } else { - linearTimeScale = 0.1f; + if (!ok) { + linearTimeScale = _linearTimeScale; } ok = true; float linearDistance = EntityActionInterface::extractFloatArgument("offset action", arguments, "linearDistance", ok, false); if (!ok) { - linearDistance = 0.0f; + linearDistance = _linearDistance; } // only change stuff if something actually changed