1
0
Fork 0

-Minor fix: Only read traffic from data/Traffic/fgtraffic.xml if that path really exists.

- Added a comment explaining why the first 1000 frames are skipped.
This commit is contained in:
durk 2007-05-31 19:53:53 +00:00
parent bbb1d2d0c3
commit 2c3dc5fca1

View file

@ -124,7 +124,8 @@ void FGTrafficManager::init()
*/ */
SGPath path = aircraftDir; SGPath path = aircraftDir;
path.append("Traffic/fgtraffic.xml"); path.append("Traffic/fgtraffic.xml");
readXML(path.str(),*this); if (path.exists())
readXML(path.str(),*this);
aircraftDir.append("AI/Aircraft"); aircraftDir.append("AI/Aircraft");
if (aircraftDir.exists()) if (aircraftDir.exists())
@ -169,6 +170,9 @@ void FGTrafficManager::init()
void FGTrafficManager::update(double /*dt*/) void FGTrafficManager::update(double /*dt*/)
{ {
//SG_LOG( SG_GENERAL, SG_INFO, "Running TrafficManager::Update() "); //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) if (runCount < 1000)
{ {
runCount++; runCount++;