mirror of
https://github.com/JulianGro/overte.git
synced 2025-05-28 02:31:03 +02:00
handle case where action params are missing
This commit is contained in:
parent
71440dfbc5
commit
90ae1fea8b
1 changed files with 4 additions and 9 deletions
|
@ -95,26 +95,21 @@ bool ObjectActionOffset::updateArguments(QVariantMap arguments) {
|
||||||
glm::vec3 pointToOffsetFrom =
|
glm::vec3 pointToOffsetFrom =
|
||||||
EntityActionInterface::extractVec3Argument("offset action", arguments, "pointToOffsetFrom", ok, true);
|
EntityActionInterface::extractVec3Argument("offset action", arguments, "pointToOffsetFrom", ok, true);
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
return false;
|
pointToOffsetFrom = _pointToOffsetFrom;
|
||||||
}
|
}
|
||||||
|
|
||||||
ok = true;
|
ok = true;
|
||||||
float linearTimeScale =
|
float linearTimeScale =
|
||||||
EntityActionInterface::extractFloatArgument("offset action", arguments, "linearTimeScale", ok, false);
|
EntityActionInterface::extractFloatArgument("offset action", arguments, "linearTimeScale", ok, false);
|
||||||
if (ok) {
|
if (!ok) {
|
||||||
if (linearTimeScale <= 0.0f) {
|
linearTimeScale = _linearTimeScale;
|
||||||
qDebug() << "offset action -- linearTimeScale must be greater than zero.";
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
linearTimeScale = 0.1f;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ok = true;
|
ok = true;
|
||||||
float linearDistance =
|
float linearDistance =
|
||||||
EntityActionInterface::extractFloatArgument("offset action", arguments, "linearDistance", ok, false);
|
EntityActionInterface::extractFloatArgument("offset action", arguments, "linearDistance", ok, false);
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
linearDistance = 0.0f;
|
linearDistance = _linearDistance;
|
||||||
}
|
}
|
||||||
|
|
||||||
// only change stuff if something actually changed
|
// only change stuff if something actually changed
|
||||||
|
|
Loading…
Reference in a new issue