]> git.mxchange.org Git - flightgear.git/blobdiff - src/Scripting/nasal-props.cxx
NavDisplay: fix update lag when switching range or centre.
[flightgear.git] / src / Scripting / nasal-props.cxx
index 214cc5c9a4065e0add761112fbb15689dbfb8df9..2935114b9431ad6b7c7d094eef6487c8cd449a4e 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();
@@ -155,7 +157,7 @@ naRef makeVectorFromVec(naContext c, const T& vec)
     const int num_components
         = sizeof(vec.data()) / sizeof(typename T::value_type);
     naRef vector = naNewVector(c);
-    naVec_setsize(vector, num_components);
+    naVec_setsize(c, vector, num_components);
     for (int i = 0; i < num_components; ++i)
         naVec_set(vector, i, naNum(vec[i]));
     return vector;
@@ -172,7 +174,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");
+          SG_LOG(SG_NASAL, SG_ALERT, "Nasal getValue: property " << (*node)->getPath() << " is NaN");
           return naNil();
         }