Skip to content

Commit

Permalink
AP: Fix nil exception
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolaiVChr committed Dec 15, 2023
1 parent 088c84c commit b13c442
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Nasal/autoflight.nas
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ var apLoop = maketimer(1, func {
var gnds_kt = getprop("/velocities/groundspeed-kt");
var max_wp = getprop("/autopilot/route-manager/route/num");
var current_course = getprop("/autopilot/route-manager/wp/true-bearing-deg");
if (current_course == nil) current_course = getprop("orientation/true-heading-deg");
var wp_fly_to = getprop("/autopilot/route-manager/current-wp") + 1;
if (wp_fly_to < 0) {
wp_fly_to = 0;
Expand Down

0 comments on commit b13c442

Please sign in to comment.