From: durk Date: Thu, 31 May 2007 19:53:53 +0000 (+0000) Subject: -Minor fix: Only read traffic from data/Traffic/fgtraffic.xml if that path really... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=2c3dc5fca1f7b3669bc62c476a901842ab917dce;p=flightgear.git -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. --- 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++;