mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
AGL to AMSL option for naval waypoints
Introduce an option to switch waypoints to AMSL when waypoint is above water. DCS references the bottom of the sea when using AGL, which causes issues for helicopters when they try to fly at altitudes that are lower that the sea bottom, giving them a tendency to fly into the water...
This commit is contained in:
@@ -65,6 +65,9 @@ class PydcsWaypointBuilder:
|
||||
name=self.dcs_name_for_waypoint(),
|
||||
)
|
||||
|
||||
waypoint.alt_type = self.waypoint.alt_type
|
||||
if self.flight.is_helo and self.flight.coalition.game.settings.switch_baro_fix:
|
||||
self.switch_to_baro_if_in_sea(waypoint)
|
||||
if self.waypoint.flyover:
|
||||
waypoint.action = PointAction.FlyOverPoint
|
||||
# It seems we need to leave waypoint.type exactly as it is even
|
||||
@@ -75,13 +78,19 @@ class PydcsWaypointBuilder:
|
||||
waypoint.alt = 0
|
||||
waypoint.alt_type = "RADIO"
|
||||
|
||||
waypoint.alt_type = self.waypoint.alt_type
|
||||
tot = self.flight.flight_plan.tot_for_waypoint(self.waypoint)
|
||||
if tot is not None:
|
||||
self.set_waypoint_tot(waypoint, tot)
|
||||
self.add_tasks(waypoint)
|
||||
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)
|
||||
):
|
||||
waypoint.alt_type = "BARO"
|
||||
|
||||
def ai_despawn(
|
||||
self, waypoint: MovingPoint, ignore_landing_wpt: bool = False
|
||||
) -> bool:
|
||||
|
||||
@@ -798,7 +798,7 @@ class Settings:
|
||||
section=GAMEPLAY_SECTION,
|
||||
choices={v.value: v for v in StartType},
|
||||
default=StartType.COLD,
|
||||
detail=("Default start type for flights containing Player/Client slots."),
|
||||
detail="Default start type for flights containing Player/Client slots.",
|
||||
)
|
||||
nevatim_parking_fix: bool = boolean_option(
|
||||
"Force air-starts for aircraft at Nevatim and Ramon Airbase inoperable parking slots",
|
||||
@@ -810,6 +810,16 @@ class Settings:
|
||||
"which are known to work as of DCS World 2.9.4.53990."
|
||||
),
|
||||
)
|
||||
switch_baro_fix: bool = boolean_option(
|
||||
"Switch altitude type of waypoints to AMSL above seas for helicopters",
|
||||
page=MISSION_GENERATOR_PAGE,
|
||||
section=GAMEPLAY_SECTION,
|
||||
default=True, # TODO: set to False or remove this when DCS is fixed?
|
||||
detail=(
|
||||
"AGL seems to reference the bottom of the sea which causes issues for helicopters"
|
||||
" trying to fly at altitudes lower than the sea-bottom."
|
||||
),
|
||||
)
|
||||
limit_ai_radios: bool = boolean_option(
|
||||
"Limit AI radio callouts",
|
||||
page=MISSION_GENERATOR_PAGE,
|
||||
|
||||
Reference in New Issue
Block a user