1
0
Fork 0

David Luff:

The one to fg_init.cxx initialises the AI subsystem regardless of whether it's enabled or not so that later enabling by the user doesn't crash it, and the one to main.cxx avoids running the ATC manager and ATC display system unless enabled.
This commit is contained in:
ehofman 2003-04-01 13:42:10 +00:00
parent c3cefaf883
commit cdd7998c90
2 changed files with 7 additions and 7 deletions

View file

@ -1523,11 +1523,9 @@ bool fgInitSubsystems() {
// Initialise the AI Manager
////////////////////////////////////////////////////////////////////
if (fgGetBool("/sim/ai-traffic/enabled")) {
SG_LOG(SG_GENERAL, SG_INFO, " AI Manager");
globals->set_AI_mgr(new FGAIMgr);
globals->get_AI_mgr()->init();
}
SG_LOG(SG_GENERAL, SG_INFO, " AI Manager");
globals->set_AI_mgr(new FGAIMgr);
globals->get_AI_mgr()->init();
#ifdef ENABLE_AUDIO_SUPPORT

View file

@ -892,7 +892,8 @@ void fgRenderFrame() {
// Use the hud_and_panel ssgSimpleState for rendering the ATC output
// This only works properly if called before the panel call
globals->get_ATC_display()->update(delta_time_sec);
if((fgGetBool("/sim/ATC/enabled")) || (fgGetBool("/sim/ai-traffic/enabled")))
globals->get_ATC_display()->update(delta_time_sec);
// update the panel subsystem
if ( globals->get_current_panel() != NULL ) {
@ -1184,7 +1185,8 @@ static void fgMainLoop( void ) {
#endif
// Run ATC subsystem
globals->get_ATC_mgr()->update(delta_time_sec);
if (fgGetBool("/sim/ATC/enabled"))
globals->get_ATC_mgr()->update(delta_time_sec);
// Run the AI subsystem
if (fgGetBool("/sim/ai-traffic/enabled"))