[gpsnav] Correct wpindex check

pull/2164/head
storm64 2022-10-03 13:18:40 +02:00 committed by GitHub
parent b292a54677
commit 459a1b91d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -43,7 +43,7 @@ function drawCompass(course) {
}
xpos += 12;
}
if (wpindex != 0) {
if (wpindex >= 0) {
var bpos = brg - course;
if (bpos > 180) bpos -= 360;
if (bpos < -180) bpos += 360;
@ -241,7 +241,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,