mirror of https://github.com/espruino/BangleApps
[gpsnav] Correct wpindex check
parent
b292a54677
commit
459a1b91d9
|
@ -43,7 +43,7 @@ function drawCompass(course) {
|
||||||
}
|
}
|
||||||
xpos += 12;
|
xpos += 12;
|
||||||
}
|
}
|
||||||
if (wpindex != 0) {
|
if (wpindex >= 0) {
|
||||||
var bpos = brg - course;
|
var bpos = brg - course;
|
||||||
if (bpos > 180) bpos -= 360;
|
if (bpos > 180) bpos -= 360;
|
||||||
if (bpos < -180) bpos += 360;
|
if (bpos < -180) bpos += 360;
|
||||||
|
@ -241,7 +241,7 @@ function nextwp(inc) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function doselect() {
|
function doselect() {
|
||||||
if (selected && wpindex != 0 && waypoints[wpindex].lat === undefined && savedfix.fix) {
|
if (selected && wpindex >= 0 && waypoints[wpindex].lat === undefined && savedfix.fix) {
|
||||||
waypoints[wpindex] = {
|
waypoints[wpindex] = {
|
||||||
name: "@" + wp.name,
|
name: "@" + wp.name,
|
||||||
lat: savedfix.lat,
|
lat: savedfix.lat,
|
||||||
|
|
Loading…
Reference in New Issue