]> git.mxchange.org Git - flightgear.git/commitdiff
Support Dave Luff's AI plane if /sim/ai-traffic/enabled is set to
authordavid <david>
Wed, 2 Oct 2002 15:25:58 +0000 (15:25 +0000)
committerdavid <david>
Wed, 2 Oct 2002 15:25:58 +0000 (15:25 +0000)
true.

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

index 3e9de016af178ff0880dbe55bb8bd9f5c5d5d02d..aee83504f44ca19bdde5f336191b9ac605140575 100644 (file)
@@ -992,9 +992,11 @@ bool fgInitSubsystems( void ) {
     // Initialise the AI Manager 
     ////////////////////////////////////////////////////////////////////
 
-    SG_LOG(SG_GENERAL, SG_INFO, "  AI Manager");
-    // globals->set_AI_mgr(new FGAIMgr);
-    // globals->get_AI_mgr()->init();     
+    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();
+    }
 
     ////////////////////////////////////////////////////////////////////
     // Initialize the built-in commands.
index b8bbb5ccd66da7d11df7feec2b2c700aeb65122d..01e07976439198ae915fb83e670aee8034a91e7a 100644 (file)
@@ -91,7 +91,7 @@ SG_USING_STD(endl);
 
 #include <ATC/ATCmgr.hxx>
 #include <ATC/ATCdisplay.hxx>
-//#include <ATC/AIMgr.hxx>
+#include <ATC/AIMgr.hxx>
 
 
 #include <Autopilot/newauto.hxx>
@@ -1097,7 +1097,8 @@ static void fgMainLoop( void ) {
     globals->get_ATC_mgr()->update(delta_time_sec);
 
     // Run the AI subsystem
-    // globals->get_AI_mgr()->update(delta_time_sec);
+    if (fgGetBool("/sim/ai-traffic/enabled"))
+        globals->get_AI_mgr()->update(delta_time_sec);
 
     // Run flight model