diff --git a/src/Main/fg_commands.cxx b/src/Main/fg_commands.cxx index 36554cb23..76b0441fd 100644 --- a/src/Main/fg_commands.cxx +++ b/src/Main/fg_commands.cxx @@ -168,9 +168,10 @@ static bool do_save (const SGPropertyNode * arg, SGCommandState ** state) { const string &file = arg->getStringValue("file", "fgfs.sav"); + bool write_all = arg->getBoolValue("write-all", false); SG_LOG(SG_INPUT, SG_INFO, "Saving flight"); ofstream output(file.c_str()); - if (output.good() && fgSaveFlight(output)) { + if (output.good() && fgSaveFlight(output, write_all)) { output.close(); SG_LOG(SG_INPUT, SG_INFO, "Saved flight to " << file); return true; diff --git a/src/Main/fg_props.cxx b/src/Main/fg_props.cxx index b7966352e..a65196ca9 100644 --- a/src/Main/fg_props.cxx +++ b/src/Main/fg_props.cxx @@ -864,10 +864,10 @@ fgUpdateProps () * Save the current state of the simulator to a stream. */ bool -fgSaveFlight (ostream &output) +fgSaveFlight (ostream &output, bool write_all) { try { - writeProperties(output, globals->get_props()); + writeProperties(output, globals->get_props(), write_all); } catch (const sg_exception &e) { guiErrorMessage("Error saving flight: ", e); return false; diff --git a/src/Main/fg_props.hxx b/src/Main/fg_props.hxx index 9d9072497..a21c438c5 100644 --- a/src/Main/fg_props.hxx +++ b/src/Main/fg_props.hxx @@ -43,9 +43,11 @@ extern void fgUpdateProps (); * so that the current flight can be restored later. * * @param output The output stream to write the XML save file to. + * @param write_all If true, write all properties rather than + * just the ones flagged as archivable. * @return true if the flight was saved successfully. */ -extern bool fgSaveFlight (ostream &output); +extern bool fgSaveFlight (ostream &output, bool write_all = false); /**