From 2b0588d170418f842a4191c5af3dae3a975c7cae Mon Sep 17 00:00:00 2001 From: fredb Date: Sun, 7 Sep 2008 08:44:48 +0000 Subject: [PATCH] James Turner : If someone could kindly apply the attached patch, that'll keep this from crashing, I believe. The fix is easy since FGAirport can now always provide an active runway - there's no need to guess at random, or rely on the tower having set one up. --- src/ATCDCL/AILocalTraffic.cxx | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/ATCDCL/AILocalTraffic.cxx b/src/ATCDCL/AILocalTraffic.cxx index 2156fbe13..bcaab722e 100644 --- a/src/ATCDCL/AILocalTraffic.cxx +++ b/src/ATCDCL/AILocalTraffic.cxx @@ -165,18 +165,9 @@ void FGAILocalTraffic::GetAirportDetails(const string& id) { void FGAILocalTraffic::GetRwyDetails(const string& id) { //cout << "GetRwyDetails called" << endl; - if(_controlled) { - rwy.rwyID = tower->GetActiveRunway(); - } else { - // TODO - get a proper runway ID from uncontrolled airports - rwy.rwyID = "00"; - } - - // Now we need to get the threshold position and rwy heading - const FGAirport* apt = fgFindAirportID(id); assert(apt); - FGRunway runway(apt->getRunwayByIdent(rwy.rwyID)); + FGRunway runway(apt->getActiveRunwayForUsage()); double hdg = runway._heading; double other_way = hdg - 180.0; -- 2.39.5