]> git.mxchange.org Git - flightgear.git/blobdiff - src/Airports/runways.cxx
Change tower location to an SGGeod. Include taxiways too.
[flightgear.git] / src / Airports / runways.cxx
index 8680818ff62e8aab8b45935c09d0785f012dad12..4018cc5bcc5d735b10c0d60a0b4015ee11f2730c 100644 (file)
@@ -80,13 +80,12 @@ void FGRunwayList::add( const string& id, const string& rwy_no,
     rwy._smoothness = smoothness;
     rwy._dist_remaining = dist_remaining;
 
-    if ( rwy_no == "xxx" ) {
+    if ( rwy_no[0] == 'x' ) {
         rwy._type = "taxiway";
-        // don't insert taxiways into the DB for now
     } else {
         rwy._type = "runway";
-        runways.insert(pair<const string, FGRunway>(rwy._id, rwy));
     }
+    runways.insert(pair<const string, FGRunway>(rwy._id, rwy));
 }
 
 
@@ -96,6 +95,11 @@ void FGRunwayList::add( const string& id, const string& rwy_no,
 static string GetReverseRunwayNo(string& rwyno) {      
     // cout << "Original rwyno = " << rwyNo << '\n';
     
+    // Helipads don't have a seperate number per end
+    if(rwyno.size() && (rwyno[0] == 'H' || rwyno[0] == 'h' || rwyno[0] == 'x')) {
+       return rwyno;
+    }
+    
     // standardize input number
     string tmp = rwyno.substr(1, 1);
     if (( tmp == "L" || tmp == "R" || tmp == "C" ) || (rwyno.size() == 1)) {
@@ -257,7 +261,8 @@ string FGRunwayList::search( const string& aptid, const int tgt_hdg ) {
            found_dir = 180.0;
        }
        
-       next( &tmp_r );
+        if (!next( &tmp_r ))
+            break;
     }
     
     // SG_LOG( SG_GENERAL, SG_INFO, "closest runway = " << r._rwy_no