Showing 1 changed files with 4 additions and 5 deletions
+4 -5
Nasal/display.nas
... ...
@@ -316,18 +316,17 @@ var displayClass = {
316 316
                         var geo = greatCircleMove(
317 317
                                 data._msa_track,
318 318
                                 (data._msa_spd / 12) / 10 * data._msa_point);
319
-                        var (alt, _) = geodinfo(geo.lat, geo.lon, 10000);
320
-                        if (data._msa_alt_intern < alt) data._msa_alt_intern = alt;
319
+                        var _geodinfo = geodinfo(geo.lat, geo.lon, 10000);
320
+                        if (_geodinfo != nil)
321
+                            if (data._msa_alt_intern < _geodinfo[0]) data._msa_alt_intern = _geodinfo[0];
321 322
                         data._msa_point += 1;
322 323
                         if (data._msa_point > 10) {
323 324
                             data._msa_alt         = math.round((1000 + data._msa_alt_intern * M2FT) / 100) * 100;
324 325
                             data._msa_point       = 0;
325 326
                             data._msa_alt_intern  = 0;
327
+                            data.timers.MSA_geodinfo.stop();
326 328
                         }
327
-                        else
328
-                            data.timers.MSA_geodinfo.restart(0);
329 329
                     });
330
-                    data.timers.MSA_geodinfo.singleShot = 1;
331 330
                 }
332 331
                 data.timers.MSA_geodinfo.start();
333 332
                 return data._msa_alt == -1 ? '-----ft' : sprintf('%5ift', data._msa_alt);