Make the Nasal NaN check less aggressive - still SG_ALERT, but return nil instead of terminating the Nasal script completely.
This commit is contained in:
parent
ed4a2369a4
commit
664817b0a7
2 changed files with 2 additions and 2 deletions
|
@ -190,7 +190,7 @@ static naRef f_getprop(naContext c, naRef me, int argc, naRef* args)
|
||||||
double dv = p->getDoubleValue();
|
double dv = p->getDoubleValue();
|
||||||
if (osg::isNaN(dv)) {
|
if (osg::isNaN(dv)) {
|
||||||
SG_LOG(SG_GENERAL, SG_ALERT, "Nasal getprop: property " << p->getPath() << " is NaN");
|
SG_LOG(SG_GENERAL, SG_ALERT, "Nasal getprop: property " << p->getPath() << " is NaN");
|
||||||
naRuntimeError(c, "getprop() would have read NaN");
|
return naNil();
|
||||||
}
|
}
|
||||||
|
|
||||||
return naNum(dv);
|
return naNum(dv);
|
||||||
|
|
|
@ -173,7 +173,7 @@ static naRef f_getValue(naContext c, naRef me, int argc, naRef* args)
|
||||||
double dv = (*node)->getDoubleValue();
|
double dv = (*node)->getDoubleValue();
|
||||||
if (osg::isNaN(dv)) {
|
if (osg::isNaN(dv)) {
|
||||||
SG_LOG(SG_GENERAL, SG_ALERT, "Nasal getValue: property " << (*node)->getPath() << " is NaN");
|
SG_LOG(SG_GENERAL, SG_ALERT, "Nasal getValue: property " << (*node)->getPath() << " is NaN");
|
||||||
naRuntimeError(c, "props.getValue() would have read NaN");
|
return naNil();
|
||||||
}
|
}
|
||||||
|
|
||||||
return naNum(dv);
|
return naNum(dv);
|
||||||
|
|
Loading…
Reference in a new issue