1
0
Fork 0

[gpsnav] Correct wpindex check

master
storm64 2022-10-03 12:39:44 +02:00 committed by GitHub
parent a456f4ff62
commit b292a54677
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -36,7 +36,7 @@ function drawCompass(course) {
}
xpos+=15;
}
if (wpindex!=0) {
if (wpindex>=0) {
var bpos = brg - course;
if (bpos>180) bpos -=360;
if (bpos<-180) bpos +=360;
@ -220,7 +220,7 @@ function nextwp(inc){
}
function doselect(){
if (selected && wpindex!=0 && waypoints[wpindex].lat===undefined && savedfix.fix) {
if (selected && wpindex<=0 && waypoints[wpindex].lat===undefined && savedfix.fix) {
waypoints[wpindex] ={name:"@"+wp.name, lat:savedfix.lat, lon:savedfix.lon};
wp = waypoints[wpindex];
require("waypoints").save(waypoints);