Skip to content
This repository has been archived by the owner on May 16, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1520 from Working-Title-MSFS-Mods/bugfix/lnav-dir…
Browse files Browse the repository at this point in the history
…ector-normalize-targetheading-after-magvar

add AutopilotMath.normalizeHeading to targetHeading in setCourse method
  • Loading branch information
cwburnett authored May 17, 2022
2 parents f682f8f + a15d4c4 commit 3bf773a
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ class LNavDirector {
const windCorrection = AutopilotMath.windCorrectionAngle(degreesTrue, planeState.trueAirspeed, currWindDirection, planeState.windSpeed);

let targetHeading = AutopilotMath.normalizeHeading(degreesTrue - windCorrection);
targetHeading = GeoMath.correctMagvar(targetHeading, planeState.magVar);
targetHeading = AutopilotMath.normalizeHeading(GeoMath.correctMagvar(targetHeading, planeState.magVar));

Coherent.call("HEADING_BUG_SET", 2, targetHeading);
}
Expand Down

0 comments on commit 3bf773a

Please sign in to comment.