]> git.mxchange.org Git - flightgear.git/blobdiff - src/Scripting/nasal-props.cxx
Merge branch 'attenuation' into navaids-radio
[flightgear.git] / src / Scripting / nasal-props.cxx
index 0ea341b08ff2e18283ec46f5ab82ea2d380945a7..15a3016f3f31c9f1669625100132fe543d6c053a 100644 (file)
@@ -103,6 +103,7 @@ static naRef f_getAttribute(naContext c, naRef me, int argc, naRef* args)
     else if(!strcmp(a, "trace-read"))  attr = SGPropertyNode::TRACE_READ;
     else if(!strcmp(a, "trace-write")) attr = SGPropertyNode::TRACE_WRITE;
     else if(!strcmp(a, "userarchive")) attr = SGPropertyNode::USERARCHIVE;
+    else if(!strcmp(a, "preserve"))    attr = SGPropertyNode::PRESERVE;
     else {
         naRuntimeError(c, "props.getAttribute() with invalid attribute");
         return naNil();
@@ -128,6 +129,7 @@ static naRef f_setAttribute(naContext c, naRef me, int argc, naRef* args)
     else if(!strcmp(a, "trace-read"))  attr = SGPropertyNode::TRACE_READ;
     else if(!strcmp(a, "trace-write")) attr = SGPropertyNode::TRACE_WRITE;
     else if(!strcmp(a, "userarchive")) attr = SGPropertyNode::USERARCHIVE;
+    else if(!strcmp(a, "preserve"))    attr = SGPropertyNode::PRESERVE;
     else {
         naRuntimeError(c, "props.setAttribute() with invalid attribute");
         return naNil();
@@ -173,7 +175,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);