]> git.mxchange.org Git - flightgear.git/commitdiff
David Luff:
authorehofman <ehofman>
Tue, 1 Apr 2003 13:42:10 +0000 (13:42 +0000)
committerehofman <ehofman>
Tue, 1 Apr 2003 13:42:10 +0000 (13:42 +0000)
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.

src/Main/fg_init.cxx
src/Main/main.cxx

index 04f8ca1cbe4a293781dfd2c6e1323110586beae9..e2e23766e1cc09eca5ded03b21e99b8325422a11 100644 (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
index ab2ded38fa7f3929025619fd656ef36ec87cc266..d583fbd5ce246a01a11bab4600442de8c3798446 100644 (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"))