#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:
parent
3986e1fe3a
commit
38ca3dda60
1 changed files with 8 additions and 8 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Reference in a new issue