1
0
Fork 0

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
This commit is contained in:
david 2002-03-14 14:25:30 +00:00
parent 56fef38054
commit 753242577f
2 changed files with 14 additions and 1 deletions

View 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));
//

View 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.