1
0
Fork 0

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:
James Turner 2011-01-14 20:04:20 +00:00
parent ed4a2369a4
commit 664817b0a7
2 changed files with 2 additions and 2 deletions

View file

@ -190,7 +190,7 @@ static naRef f_getprop(naContext c, naRef me, int argc, naRef* args)
double dv = p->getDoubleValue();
if (osg::isNaN(dv)) {
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);

View file

@ -173,7 +173,7 @@ static naRef f_getValue(naContext c, naRef me, int argc, naRef* args)
double dv = (*node)->getDoubleValue();
if (osg::isNaN(dv)) {
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);