From 79fec97f9f2fdb9f1986d0592e77be2e5186bb92 Mon Sep 17 00:00:00 2001 From: mfranz Date: Sun, 7 Oct 2007 19:27:05 +0000 Subject: [PATCH] save some startup parameters under /sim/startup/options/. options.cxx puts them under /sim/presets/ but they aren't save there, and as fgInitPosition and its subroutines overwrite them, we lose the information about what the user really wanted. This is a temporary solution -- it really belongs into options.cxx. --- src/Main/fg_init.cxx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/Main/fg_init.cxx b/src/Main/fg_init.cxx index 810bd322c..e1aba14ee 100644 --- a/src/Main/fg_init.cxx +++ b/src/Main/fg_init.cxx @@ -1195,6 +1195,20 @@ bool fgInitPosition() { SGPropertyNode *hdg_preset = fgGetNode("/sim/presets/heading-deg", true); double hdg = hdg_preset->getDoubleValue(); + // save some start parameters, so that we can later say what the + // user really requested. TODO generalize that and move it to options.cxx + static bool start_options_saved = false; + if (!start_options_saved) { + start_options_saved = true; + SGPropertyNode *opt = fgGetNode("/sim/startup/options", true); + + opt->setDoubleValue("latitude-deg", lat_deg); + opt->setDoubleValue("longitude-deg", lon_deg); + opt->setDoubleValue("heading-deg", hdg); + opt->setStringValue("airport", apt.c_str()); + opt->setStringValue("runway", rwy_no.c_str()); + } + if (hdg > 9990.0) hdg = fgGetDouble("/environment/config/boundary/entry/wind-from-heading-deg", 270); -- 2.39.5