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