From: curt Date: Thu, 17 Aug 2000 14:58:13 +0000 (+0000) Subject: Fixed a small bug in runway closeness logic. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=1ad9f1b59eef627d40e7f9461ed887df567da3e6;p=flightgear.git Fixed a small bug in runway closeness logic. --- diff --git a/src/Main/fg_init.cxx b/src/Main/fg_init.cxx index bd0818d9a..50e46c70e 100644 --- a/src/Main/fg_init.cxx +++ b/src/Main/fg_init.cxx @@ -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 = " <<