From: david Date: Wed, 2 Oct 2002 15:25:58 +0000 (+0000) Subject: Support Dave Luff's AI plane if /sim/ai-traffic/enabled is set to X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=03b508adb7a733ac682927df8c72c5c91cce1e82;p=flightgear.git Support Dave Luff's AI plane if /sim/ai-traffic/enabled is set to true. --- diff --git a/src/Main/fg_init.cxx b/src/Main/fg_init.cxx index 3e9de016a..aee83504f 100644 --- a/src/Main/fg_init.cxx +++ b/src/Main/fg_init.cxx @@ -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. diff --git a/src/Main/main.cxx b/src/Main/main.cxx index b8bbb5ccd..01e079764 100644 --- a/src/Main/main.cxx +++ b/src/Main/main.cxx @@ -91,7 +91,7 @@ SG_USING_STD(endl); #include #include -//#include +#include #include @@ -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