]> git.mxchange.org Git - flightgear.git/commitdiff
Fix a problem where the compass goes negative by the variation when close to 360...
authorehofman <ehofman>
Tue, 1 Jul 2003 08:19:41 +0000 (08:19 +0000)
committerehofman <ehofman>
Tue, 1 Jul 2003 08:19:41 +0000 (08:19 +0000)
src/Main/fg_props.cxx

index 18345fc9f281fa0ea619c8956d11a3122e039728..770ca620ea91c281920b2277b6a4418bbdfada57 100644 (file)
@@ -378,7 +378,10 @@ getMagDip ()
 static double
 getHeadingMag ()
 {
-  return current_aircraft.fdm_state->get_Psi() * SGD_RADIANS_TO_DEGREES - getMagVar();
+  double magheading;
+  magheading = current_aircraft.fdm_state->get_Psi() * SGD_RADIANS_TO_DEGREES - getMagVar();
+  if (magheading < 0) magheading += 360;
+  return magheading;
 }