Make Traffic-via-terrasync conditional
GUI dialog already set the property, just need to pick it up.
This commit is contained in:
parent
5e7574c9c2
commit
2a354e224c
2 changed files with 8 additions and 6 deletions
|
@ -101,6 +101,11 @@ static void fgMainLoop( void )
|
|||
|
||||
static void initTerrasync()
|
||||
{
|
||||
// add the terrasync root as a data path so data can be retrieved from it
|
||||
// (even if we are in read-only mode)
|
||||
std::string terraSyncDir(fgGetString("/sim/terrasync/scenery-dir"));
|
||||
globals->append_data_path(terraSyncDir);
|
||||
|
||||
if (fgGetBool("/sim/fghome-readonly", false)) {
|
||||
return;
|
||||
}
|
||||
|
@ -127,10 +132,6 @@ static void initTerrasync()
|
|||
|
||||
terra_sync->bind();
|
||||
terra_sync->init();
|
||||
|
||||
// add the terrasync root as a data path so data can be retrieved from it
|
||||
std::string terraSyncDir(fgGetString("/sim/terrasync/scenery-dir"));
|
||||
globals->append_data_path(terraSyncDir);
|
||||
}
|
||||
|
||||
static void registerMainLoop()
|
||||
|
|
|
@ -494,9 +494,10 @@ void FGTrafficManager::init()
|
|||
|
||||
assert(!doingInit);
|
||||
simgear::SGTerraSync* terraSync = static_cast<simgear::SGTerraSync*>(globals->get_subsystem("terrasync"));
|
||||
|
||||
if (terraSync) {
|
||||
bool doDataSync = fgGetBool("/sim/terrasync/ai-data-enabled");
|
||||
if (doDataSync && terraSync) {
|
||||
if (!trafficSyncRequested) {
|
||||
SG_LOG(SG_AI, SG_INFO, "Sync of AI traffic via TerraSync enabled");
|
||||
terraSync->scheduleDataDir("AI/Traffic");
|
||||
trafficSyncRequested = true;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue