]> git.mxchange.org Git - flightgear.git/commitdiff
Bugfix: ensure GPS WP1 Mag-bearing is normalised to [0..360]
authorjmt <jmt>
Sat, 13 Feb 2010 19:33:54 +0000 (19:33 +0000)
committerTim Moore <timoore33@gmail.com>
Sat, 13 Feb 2010 23:27:30 +0000 (00:27 +0100)
src/Instrumentation/gps.cxx

index 2c6f36495882344acf8d2b10ddfe32bfaec72c66..2f7455b83820b022ffbe382d2fdf0935b0df7e93 100644 (file)
@@ -1186,7 +1186,9 @@ double GPS::getWP1MagBearing() const
     return -9999.0;
   }
 
-  return _wp1TrueBearing - _magvar_node->getDoubleValue();
+  double magBearing = _wp1TrueBearing - _magvar_node->getDoubleValue();
+  SG_NORMALIZE_RANGE(magBearing, 0.0, 360.0);
+  return magBearing;
 }
 
 double GPS::getWP1CourseDeviation() const