From 505d4c5219bf46b4ec640f5dd903dda58ae7a09b Mon Sep 17 00:00:00 2001 From: ThorstenB Date: Sun, 12 Jun 2011 13:53:14 +0200 Subject: [PATCH] Do not reset persistent properties on sim-reset. Fixed ugly sim-reset issue: Persistent properties (USERARCHIVE attribute) are retained across sim sessions (when restarting the sim). So they should also be retained on sim-resets (without the need to first exit/restart the sim to make them really persistent). Also, avoid warning due to read-only properties. --- src/Main/globals.cxx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/Main/globals.cxx b/src/Main/globals.cxx index b7d9b7d6d..62ae38ffa 100644 --- a/src/Main/globals.cxx +++ b/src/Main/globals.cxx @@ -364,7 +364,10 @@ FGGlobals::saveInitialState () { initial_state = new SGPropertyNode(); - if (!copyProperties(props, initial_state)) + // copy properties which are READ/WRITEable - but not USERARCHIVEd + if (!copyProperties(props, initial_state, + SGPropertyNode::READ+SGPropertyNode::WRITE, + SGPropertyNode::READ+SGPropertyNode::WRITE+SGPropertyNode::USERARCHIVE)) SG_LOG(SG_GENERAL, SG_ALERT, "Error saving initial state"); // delete various properties from the initial state, since we want to @@ -393,8 +396,10 @@ FGGlobals::restoreInitialState () "No initial state available to restore!!!"); return; } - - if ( copyProperties(initial_state, props) ) { + // restore properties which are READ/WRITEable - but not USERARCHIVEd + if ( copyProperties(initial_state, props, + SGPropertyNode::READ+SGPropertyNode::WRITE, + SGPropertyNode::READ+SGPropertyNode::WRITE+SGPropertyNode::USERARCHIVE)) { SG_LOG( SG_GENERAL, SG_INFO, "Initial state restored successfully" ); } else { SG_LOG( SG_GENERAL, SG_INFO, -- 2.39.5