]> git.mxchange.org Git - simgear.git/blobdiff - simgear/props/props.hxx
Introduce "PRESERVE" flag to protect properties on sim reset.
[simgear.git] / simgear / props / props.hxx
index a80fc10ae7c9dc8415bcbd3d02de4673cdeb8b18..60da557d87a136838eb93ad1d79672f9d49b83be 100644 (file)
@@ -760,7 +760,8 @@ public:
     REMOVED = 8,
     TRACE_READ = 16,
     TRACE_WRITE = 32,
-    USERARCHIVE = 64
+    USERARCHIVE = 64,
+    PRESERVE = 128
   };
 
 
@@ -1786,8 +1787,12 @@ bool SGPropertyNode::tie(const SGRawValue<T> &rawValue, bool useDefault)
         _type = EXTENDED;
     _tied = true;
     _value.val = rawValue.clone();
-    if (useDefault)
+    if (useDefault) {
+        int save_attributes = getAttributes();
+        setAttribute( WRITE, true );
         setValue(old_val);
+        setAttributes( save_attributes );
+    }
     return true;
 }