1
0
Fork 0

#248: support enabling AI module at run-time

Traffic manager can also be enabled at run-time, so "ai enabled" check
also needs to be moved for traffic.
This commit is contained in:
ThorstenB 2012-04-30 19:44:11 +02:00
parent 3986e1fe3a
commit 38ca3dda60

View file

@ -138,12 +138,6 @@ void FGTrafficManager::init()
return;
}
if (!aiEnabled)
{
// traffic depends on AI module
aiEnabled = true;
}
assert(!doingInit);
doingInit = true;
if (string(fgGetString("/sim/traffic-manager/datafile")) == string("")) {
@ -267,10 +261,16 @@ void FGTrafficManager::loadHeuristics()
void FGTrafficManager::update(double /*dt */ )
{
if (!enabled || !aiEnabled || (realWxEnabled && !metarValid)) {
if (!enabled || (realWxEnabled && !metarValid)) {
return;
}
if (!aiEnabled)
{
// traffic depends on AI module
aiEnabled = true;
}
if (!inited) {
if (!doingInit) {
init();