mirror of https://github.com/espruino/BangleApps
[gpsnav] Correct wpindex check
parent
b292a54677
commit
459a1b91d9
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue