]> git.mxchange.org Git - simgear.git/blobdiff - simgear/props/props.cxx
math: Move lerp function into SGMisc.
[simgear.git] / simgear / props / props.cxx
index fce6e8ab31c54c0ec0c3db3f2dbccb593e9cadb5..5fe9bc90b10d88a19efe31489ceb9686b7662906 100644 (file)
@@ -642,7 +642,7 @@ SGPropertyNode::trace_read () const
  * Last used attribute
  * Update as needed when enum Attribute is changed
  */
-const int SGPropertyNode::LAST_USED_ATTRIBUTE = USERARCHIVE;
+const int SGPropertyNode::LAST_USED_ATTRIBUTE = PRESERVE;
 
 /**
  * Default constructor: always creates a root node.
@@ -664,7 +664,8 @@ SGPropertyNode::SGPropertyNode ()
  * Copy constructor.
  */
 SGPropertyNode::SGPropertyNode (const SGPropertyNode &node)
-  : _index(node._index),
+  : SGReferenced(node),
+    _index(node._index),
     _name(node._name),
     _parent(0),                        // don't copy the parent
     _type(node._type),
@@ -1615,8 +1616,12 @@ bool SGPropertyNode::tie (const SGRawValue<const char *> &rawValue,
     _tied = true;
     _value.val = rawValue.clone();
 
-    if (useDefault)
+    if (useDefault) {
+        int save_attributes = getAttributes();
+        setAttribute( WRITE, true );
         setStringValue(old_val.c_str());
+        setAttributes( save_attributes );
+    }
 
     return true;
 }