1
0
Fork 0

Fix a problem where the compass goes negative by the variation when close to 360 degrees

This commit is contained in:
ehofman 2003-07-01 08:19:41 +00:00
parent c5be967fba
commit 9d10d88f8f

View file

@ -378,7 +378,10 @@ getMagDip ()
static double static double
getHeadingMag () 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;
} }