Fix a problem where the compass goes negative by the variation when close to 360 degrees
This commit is contained in:
parent
c5be967fba
commit
9d10d88f8f
1 changed files with 4 additions and 1 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue