]> git.mxchange.org Git - flightgear.git/commitdiff
James Turner :
authorfredb <fredb>
Sun, 7 Sep 2008 08:44:48 +0000 (08:44 +0000)
committerfredb <fredb>
Sun, 7 Sep 2008 08:44:48 +0000 (08:44 +0000)
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

index 2156fbe13b249cd711ceb9bbb242f8a8b8cf13ed..bcaab722e3ae18386c0da2f43ea79a3b3d90fdb1 100644 (file)
@@ -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;