Improve AGL to AMSL transition for naval waypoints

Some maps have inaccurate bounds for sea-zones, thus waypoints that end up being too close to the shore may keep using AGL which could still lead to trouble. Adding a condition to check whether a point is "not on land" will likely fix this issue for maps that have gaps between sea-zones and inclusion-zones around the shoreline...
This commit is contained in:
Raffson
2024-11-09 14:49:38 +01:00
parent b5225f03a1
commit 84c4b992e0
2 changed files with 10 additions and 7 deletions

View File

@@ -85,9 +85,11 @@ class PydcsWaypointBuilder:
return waypoint
def switch_to_baro_if_in_sea(self, waypoint: MovingPoint) -> None:
if (
waypoint.alt_type == "RADIO"
and self.flight.coalition.game.theater.is_in_sea(waypoint.position)
if waypoint.alt_type == "RADIO" and (
self.flight.coalition.game.theater.is_in_sea(waypoint.position)
or not self.flight.coalition.game.theater.is_on_land(
waypoint.position, ignore_exclusion=True
)
):
waypoint.alt_type = "BARO"