]> git.mxchange.org Git - flightgear.git/commitdiff
Fixed a small bug in runway closeness logic.
authorcurt <curt>
Thu, 17 Aug 2000 14:58:13 +0000 (14:58 +0000)
committercurt <curt>
Thu, 17 Aug 2000 14:58:13 +0000 (14:58 +0000)
src/Main/fg_init.cxx

index bd0818d9a81c0f0a32998b5e463e46be9a2804a0..50e46c70e0950cf51dc8e6fe003111264371b2f4 100644 (file)
@@ -226,6 +226,7 @@ bool fgSetPosFromAirportIDandHdg( const string& id, double tgt_hdg ) {
            // forward direction
            diff = tgt_hdg - r.heading;
            while ( diff < -180.0 ) { diff += 360.0; }
+           while ( diff >  180.0 ) { diff -= 360.0; }
            diff = fabs(diff);
            FG_LOG( FG_GENERAL, FG_INFO,
                    "Runway " << r.rwy_no << " heading = " << r.heading <<
@@ -239,6 +240,7 @@ bool fgSetPosFromAirportIDandHdg( const string& id, double tgt_hdg ) {
            // reverse direction
            diff = tgt_hdg - r.heading - 180.0;
            while ( diff < -180.0 ) { diff += 360.0; }
+           while ( diff >  180.0 ) { diff -= 360.0; }
            diff = fabs(diff);
            FG_LOG( FG_GENERAL, FG_INFO,
                    "Runway -" << r.rwy_no << " heading = " <<