From 9d10d88f8f8c4f1180dd98b0324488a5ce1b152d Mon Sep 17 00:00:00 2001 From: ehofman Date: Tue, 1 Jul 2003 08:19:41 +0000 Subject: [PATCH] Fix a problem where the compass goes negative by the variation when close to 360 degrees --- src/Main/fg_props.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Main/fg_props.cxx b/src/Main/fg_props.cxx index 18345fc9f..770ca620e 100644 --- a/src/Main/fg_props.cxx +++ b/src/Main/fg_props.cxx @@ -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; } -- 2.39.5