]> git.mxchange.org Git - flightgear.git/blobdiff - src/Traffic/TrafficMgr.cxx
Modified Files:
[flightgear.git] / src / Traffic / TrafficMgr.cxx
index dd42d52f381a56f16bad648f6f37cb7015cda618..86be2196cb2e02e4da8b1a76152f65bda97089f3 100644 (file)
@@ -123,10 +123,11 @@ void FGTrafficManager::init()
    * until we have some AI models with traffic in the base package
    */ 
   SGPath path = aircraftDir;
-  path.append("/Traffic/fgtraffic.xml");
-  readXML(path.str(),*this);
+  path.append("Traffic/fgtraffic.xml");
+  if (path.exists())
+    readXML(path.str(),*this);
 
-  aircraftDir.append("AI/Aircraft/");
+  aircraftDir.append("AI/Aircraft");
   if (aircraftDir.exists())
     {
       if((d = ulOpenDir(aircraftDir.c_str())) == NULL)
@@ -166,14 +167,18 @@ void FGTrafficManager::init()
   //cerr << "Done initializing schedules" << endl;
 }
 
-void FGTrafficManager::update(double something)
+void FGTrafficManager::update(double /*dt*/)
 {
   //SG_LOG( SG_GENERAL, SG_INFO, "Running TrafficManager::Update() ");
+  // Hack alert: Skip running for the first frames 1000 after 
+  // initialization to allow proper initialization of wheather stuff 
+  // and runway assignments
   if (runCount < 1000)
     {
       runCount++;
       return;
     }
+  //runCount = 0;
   time_t now = time(NULL) + fgGetLong("/sim/time/warp");
   if (scheduledAircraft.size() == 0) {
     //SG_LOG( SG_GENERAL, SG_INFO, "Returned Running TrafficManager::Update() ");
@@ -188,7 +193,7 @@ void FGTrafficManager::update(double something)
     {
       // after proper initialization, we shouldnt get here.
       // But let's make sure
-      cerr << "Failed to update aircraft schedule in traffic manager" << endl;
+      SG_LOG( SG_GENERAL, SG_ALERT, "Failed to update aircraft schedule in traffic manager");
     }
   currAircraft++;
   //SG_LOG( SG_GENERAL, SG_INFO, "Done Running TrafficManager::Update() ");