* 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/");
- if (aircraftDir.exists())
+ aircraftDir.append("AI/Aircraft");
+ if ((d = ulOpenDir(aircraftDir.c_str())) != NULL)
{
- if((d = ulOpenDir(aircraftDir.c_str())) == NULL)
- return;
while((dent = ulReadDir(d)) != NULL) {
//cerr << "Scanning : " << dent->d_name << endl;
if (string(dent->d_name) != string(".") &&
//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() ");
{
// 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() ");