From 03b508adb7a733ac682927df8c72c5c91cce1e82 Mon Sep 17 00:00:00 2001 From: david Date: Wed, 2 Oct 2002 15:25:58 +0000 Subject: [PATCH] Support Dave Luff's AI plane if /sim/ai-traffic/enabled is set to true. --- src/Main/fg_init.cxx | 8 +++++--- src/Main/main.cxx | 5 +++-- 2 files changed, 8 insertions(+), 5 deletions(-) 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 -- 2.39.5