From 753242577f4d51559803031cea4721eac474adf4 Mon Sep 17 00:00:00 2001 From: david Date: Thu, 14 Mar 2002 14:25:30 +0000 Subject: [PATCH] More work on saving and restoring flights. Restoring a flight is not working in a running FlightGear session because of JSBSim trim-routine problems, but it does work from the command-line now, i.e. fgfs fgfs.sav --- src/Cockpit/panel_io.cxx | 2 +- src/Main/fg_props.cxx | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/Cockpit/panel_io.cxx b/src/Cockpit/panel_io.cxx index 763d40ac3..9eb5861b9 100644 --- a/src/Cockpit/panel_io.cxx +++ b/src/Cockpit/panel_io.cxx @@ -708,7 +708,7 @@ readPanel (const SGPropertyNode * root) // conditional removed by jim wilson to allow panel xml code // with y-offset defined to work... - // if (!fgHasNode("/sim/panel/y-offset")) + if (!fgHasNode("/sim/panel/y-offset")) fgSetInt("/sim/panel/y-offset", root->getIntValue("y-offset", 0)); // diff --git a/src/Main/fg_props.cxx b/src/Main/fg_props.cxx index 357ab530a..ebbc4bc87 100644 --- a/src/Main/fg_props.cxx +++ b/src/Main/fg_props.cxx @@ -636,6 +636,14 @@ fgUpdateProps () bool fgSaveFlight (ostream &output, bool write_all) { + + fgSetBool("/sim/startup/onground", false); + fgSetArchivable("/sim/startup/onground"); + fgSetBool("/sim/startup/trim", false); + fgSetArchivable("/sim/startup/trim"); + fgSetString("/sim/startup/speed-set", "UVW"); + fgSetArchivable("/sim/startup/speed-set"); + try { writeProperties(output, globals->get_props(), write_all); } catch (const sg_exception &e) { @@ -659,6 +667,11 @@ fgLoadFlight (istream &input) guiErrorMessage("Error reading saved flight: ", e); return false; } + + fgSetBool("/sim/startup/onground", false); + fgSetBool("/sim/startup/trim", false); + fgSetString("/sim/startup/speed-set", "UVW"); + copyProperties(&props, globals->get_props()); // When loading a flight, make it the // new initial state.