Fixed a small bug in runway closeness logic.
This commit is contained in:
parent
72b0ac307d
commit
1ad9f1b59e
1 changed files with 2 additions and 0 deletions
|
@ -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 = " <<
|
||||
|
|
Loading…
Add table
Reference in a new issue