mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Un-pydantic FlightWaypoint.
Apparently it's a bad idea to try to make the core data pydantic models, and those should really be treated more as a view-model. Doing otherwise causes odd patterns (like the UI info I had leaked into the core type), and makes it harder to interop with third-party types.
This commit is contained in:
@@ -768,7 +768,7 @@ class Waypoint {
|
||||
}
|
||||
|
||||
position() {
|
||||
return this.waypoint.latlng;
|
||||
return this.waypoint.position;
|
||||
}
|
||||
|
||||
shouldMark() {
|
||||
@@ -783,10 +783,8 @@ class Waypoint {
|
||||
}
|
||||
|
||||
async description(dragging) {
|
||||
const alt = Math.floor(
|
||||
this.waypoint.alt.distance_in_meters * METERS_TO_FEET
|
||||
);
|
||||
const altRef = this.waypoint.alt_type == "BARO" ? "MSL" : "AGL";
|
||||
const alt = this.waypoint.altitude_ft;
|
||||
const altRef = this.waypoint.altitude_reference;
|
||||
return (
|
||||
`${this.number} ${this.waypoint.name}<br />` +
|
||||
`${alt} ft ${altRef}<br />` +
|
||||
|
||||
Reference in New Issue
Block a user