Skip to content

Commit 2014acf

Browse files
committed
preserve server waypoint coordinates during MSColab merge
1 parent 0f0d1bd commit 2014acf

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

mslib/msui/flighttrack.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,17 @@ class Waypoint:
143143

144144
def __init__(self, lat=0., lon=0., flightlevel=0., location="", comments=""):
145145
self.location = location
146-
locations = config_loader(dataset='locations')
147-
if location in locations:
148-
self.lat, self.lon = locations[location]
149-
else:
150-
self.lat = lat
151-
self.lon = lon
146+
147+
# Always trust explicitly provided coordinates first
148+
self.lat = lat
149+
self.lon = lon
150+
151+
# Only resolve location name if coordinates are not provided
152+
if (lat == 0.0 and lon == 0.0) and location:
153+
locations = config_loader(dataset='locations')
154+
if location in locations:
155+
self.lat, self.lon = locations[location]
156+
152157
self.flightlevel = flightlevel
153158
self.pressure = thermolib.flightlevel2pressure(flightlevel * units.hft).magnitude
154159
self.distance_to_prev = 0.

0 commit comments

Comments
 (0)