mirror of
https://github.com/overte-org/overte.git
synced 2025-04-16 05:48:39 +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 =
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue