1
0
Fork 0

#803: apply hotfix to revive "--carrier" option.

This commit is contained in:
ThorstenB 2012-07-14 10:00:52 +02:00
parent 39a7caae15
commit 00fe1e3445

View file

@ -1269,6 +1269,29 @@ bool fgInitSubsystems() {
// initialize methods that depend on other subsystems.
globals->get_subsystem_mgr()->postinit();
////////////////////////////////////////////////////////////////////
// TODO FIXME! UGLY KLUDGE!
////////////////////////////////////////////////////////////////////
{
/* Scenarios require Nasal, so FGAIManager loads the scenarios,
* including its models such as a/c carriers, in its 'postinit',
* which is the very last thing we do.
* fgInitPosition is called very early in main.cxx/fgIdleFunction,
* one of the first things we do, long before scenarios/carriers are
* loaded. => When requested "initial preset position" relates to a
* carrier, recalculate the 'initial' position here (how have things
* ever worked before this hack - this init sequence has always been
* this way...?)*/
std::string carrier = fgGetString("/sim/presets/carrier","");
if (carrier != "")
{
// clear preset location and re-trigger position setup
fgSetDouble("/sim/presets/longitude-deg", 9999);
fgSetDouble("/sim/presets/latitude-deg", 9999);
fgInitPosition();
}
}
////////////////////////////////////////////////////////////////////////
// End of subsystem initialization.
////////////////////////////////////////////////////////////////////