]> git.mxchange.org Git - flightgear.git/commitdiff
Fix for runway search glitch
authortimoore <timoore>
Sun, 23 Sep 2007 20:55:55 +0000 (20:55 +0000)
committertimoore <timoore>
Sun, 23 Sep 2007 20:55:55 +0000 (20:55 +0000)
Suggested by K.Hoercher <wbhoer@gmail.com>

src/Airports/runways.cxx

index 4018cc5bcc5d735b10c0d60a0b4015ee11f2730c..70679c21fb17545eef1e5f3b9ce7ffa613068aa5 100644 (file)
@@ -240,7 +240,7 @@ string FGRunwayList::search( const string& aptid, const int tgt_hdg ) {
         // SG_LOG( SG_GENERAL, SG_INFO,
         //        "Runway " << tmp_r._rwy_no << " heading = "
        //         << tmp_r._heading << " diff = " << diff );
-       if ( diff < min_diff ) {
+       if ((diff < min_diff) && (tmp_r._type == "runway")) {
            min_diff = diff;
            r = tmp_r;
            found_dir = 0;
@@ -255,7 +255,7 @@ string FGRunwayList::search( const string& aptid, const int tgt_hdg ) {
         //        "Runway -" << tmp_r._rwy_no << " heading = " <<
         //        tmp_r._heading + 180.0 <<
         //        " diff = " << diff );
-       if ( diff < min_diff ) {
+       if ((diff < min_diff) && (tmp_r._type == "runway")) {
            min_diff = diff;
            r = tmp_r;
            found_dir = 180.0;