1
0
Fork 0

fix another victim of the new runway search method

This commit is contained in:
mfranz 2007-10-05 14:34:04 +00:00
parent f8b8077801
commit 516ef6bc4b

View file

@ -1185,7 +1185,6 @@ bool fgInitPosition() {
string apt = fgGetString("/sim/presets/airport-id");
string rwy_no = fgGetString("/sim/presets/runway");
bool rwy_req = fgGetBool("/sim/presets/runway-requested");
double hdg = fgGetDouble("/sim/presets/heading-deg");
string vor = fgGetString("/sim/presets/vor-id");
double vor_freq = fgGetDouble("/sim/presets/vor-freq");
string ndb = fgGetString("/sim/presets/ndb-id");
@ -1193,6 +1192,8 @@ bool fgInitPosition() {
string carrier = fgGetString("/sim/presets/carrier");
string parkpos = fgGetString("/sim/presets/parkpos");
string fix = fgGetString("/sim/presets/fix");
SGPropertyNode *hdg_preset = fgGetNode("/sim/presets/heading-deg", true);
double hdg = hdg_preset->getDoubleValue();
if (hdg > 9990.0)
hdg = fgGetDouble("/environment/config/boundary/entry/wind-from-heading-deg", 270);
@ -1217,6 +1218,9 @@ bool fgInitPosition() {
}
}
if (hdg_preset->getDoubleValue() > 9990.0)
hdg_preset->setDoubleValue(hdg);
if ( !set_pos && !vor.empty() ) {
// a VOR is requested
if ( fgSetPosFromNAV( vor, vor_freq ) ) {
@ -1256,15 +1260,14 @@ bool fgInitPosition() {
fgGetDouble("/sim/presets/longitude-deg") );
fgSetDouble( "/position/latitude-deg",
fgGetDouble("/sim/presets/latitude-deg") );
fgSetDouble( "/orientation/heading-deg",
fgGetDouble("/sim/presets/heading-deg") );
fgSetDouble( "/orientation/heading-deg", hdg_preset->getDoubleValue());
// determine if this should be an on-ground or in-air start
if ((fabs(gs) > 0.01 || fabs(od) > 0.1 || alt > 0.1) && carrier.empty()) {
fgSetBool("/sim/presets/onground", false);
} else {
fgSetBool("/sim/presets/onground", true);
}
}
return true;
}