1
0
Fork 0

src/Main/fg_init.cxx: workaround for JSBSim failure because of reliance on FGReplay.

JSBSim fails on startup if some properties are not already created; some of
these are created by FGReplay, and this is going wrong now that FGReplay is
being run after the FDM.

So have added a hack where we call FGReplay::init() as soone as FGReplay has
been created.
This commit is contained in:
Julian Smith 2021-04-01 20:37:49 +01:00
parent df0f3e1b47
commit 0294db919f

View file

@ -1103,7 +1103,14 @@ void fgCreateSubsystems(bool duringReset) {
////////////////////////////////////////////////////////////////////
// Initialize the replay subsystem
////////////////////////////////////////////////////////////////////
globals->add_new_subsystem<FGReplay>(SGSubsystemMgr::POST_FDM);
// We also call FGReplay::unit() method here, to work around a
// problem where JSBSim appears to rely on FGReplay creating certain
// properties before it is initialised. This caused problems when
// FGReplay was changed to be POST_FDM.
////////////////////////////////////////////////////////////////////
globals->add_new_subsystem<FGReplay>(SGSubsystemMgr::POST_FDM)
->init(); // Special case.
globals->add_subsystem("history", new FGFlightHistory);
#ifdef ENABLE_AUDIO_SUPPORT