From 2c3dc5fca1f7b3669bc62c476a901842ab917dce Mon Sep 17 00:00:00 2001 From: durk Date: Thu, 31 May 2007 19:53:53 +0000 Subject: [PATCH] -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. --- src/Traffic/TrafficMgr.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Traffic/TrafficMgr.cxx b/src/Traffic/TrafficMgr.cxx index d4bf83fbb..86be2196c 100644 --- a/src/Traffic/TrafficMgr.cxx +++ b/src/Traffic/TrafficMgr.cxx @@ -124,7 +124,8 @@ void FGTrafficManager::init() */ SGPath path = aircraftDir; path.append("Traffic/fgtraffic.xml"); - readXML(path.str(),*this); + if (path.exists()) + readXML(path.str(),*this); aircraftDir.append("AI/Aircraft"); if (aircraftDir.exists()) @@ -169,6 +170,9 @@ void FGTrafficManager::init() 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++;