]> git.mxchange.org Git - flightgear.git/commitdiff
save some startup parameters under /sim/startup/options/. options.cxx puts
authormfranz <mfranz>
Sun, 7 Oct 2007 19:27:05 +0000 (19:27 +0000)
committermfranz <mfranz>
Sun, 7 Oct 2007 19:27:05 +0000 (19:27 +0000)
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

index 810bd322c41ce505939011bd8489f36a618a42f5..e1aba14ee44591377b5bc6b8b3cf78a670c80b52 100644 (file)
@@ -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);