]> git.mxchange.org Git - flightgear.git/commitdiff
More work on saving and restoring flights. Restoring a flight is not
authordavid <david>
Thu, 14 Mar 2002 14:25:30 +0000 (14:25 +0000)
committerdavid <david>
Thu, 14 Mar 2002 14:25:30 +0000 (14:25 +0000)
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
src/Main/fg_props.cxx

index 763d40ac32b6dae143ab97e5d89f9dadd86f0e35..9eb5861b9bb9b9e8c5ce9bc927aaef6a08a8a61a 100644 (file)
@@ -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));
 
   //
index 357ab530a8ffd2927c550c3f92bc56a982de76d5..ebbc4bc87a8400291d322d9977f2b0eb823805d0 100644 (file)
@@ -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.