]> git.mxchange.org Git - flightgear.git/commitdiff
Make the Nasal NaN check less aggressive - still SG_ALERT, but return nil instead...
authorJames Turner <zakalawe@mac.com>
Fri, 14 Jan 2011 20:04:20 +0000 (20:04 +0000)
committerJames Turner <zakalawe@mac.com>
Fri, 14 Jan 2011 20:04:20 +0000 (20:04 +0000)
src/Scripting/NasalSys.cxx
src/Scripting/nasal-props.cxx

index 158d852e5bc7ef2d824189fd99ddf6df54489e40..1f952b325c25d05a11dba82efdd76414290bc375 100644 (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);
index 0ea341b08ff2e18283ec46f5ab82ea2d380945a7..214cc5c9a4065e0add761112fbb15689dbfb8df9 100644 (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);