Fix layout for TARCAP, Escort, and strike-like.

If there's a refuel point, nav from that, not from the patrol end/split.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1749.
This commit is contained in:
Dan Albert 2022-11-19 13:01:43 -08:00 committed by Raffson
parent 0499ded1b3
commit 6ff3a34c14
No known key found for this signature in database
GPG Key ID: B0402B2C9B764D99
3 changed files with 7 additions and 9 deletions

View File

@ -31,9 +31,7 @@ class Builder(FormationAttackBuilder[EscortFlightPlan, FormationAttackLayout]):
hold = builder.hold(self._hold_point())
join = builder.join(self.package.waypoints.join)
split = builder.split(self.package.waypoints.split)
refuel = None
if self.package.waypoints.refuel is not None:
refuel = builder.refuel(self.package.waypoints.refuel)
refuel = builder.refuel(self.package.waypoints.refuel)
initial = None
if self.package.primary_task == FlightType.STRIKE:
initial = builder.escort_hold(
@ -53,7 +51,7 @@ class Builder(FormationAttackBuilder[EscortFlightPlan, FormationAttackLayout]):
split=split,
refuel=refuel,
nav_from=builder.nav_path(
split.position,
refuel.position,
self.flight.arrival.position,
self.doctrine.ingress_altitude,
),

View File

@ -184,9 +184,7 @@ class FormationAttackBuilder(IBuilder[FlightPlanT, LayoutT], ABC):
hold = builder.hold(self._hold_point())
join = builder.join(self.package.waypoints.join)
split = builder.split(self.package.waypoints.split)
refuel = None
if self.package.waypoints.refuel is not None:
refuel = builder.refuel(self.package.waypoints.refuel)
refuel = builder.refuel(self.package.waypoints.refuel)
ingress = builder.ingress(
ingress_type, self.package.waypoints.ingress, self.package.target
@ -213,7 +211,7 @@ class FormationAttackBuilder(IBuilder[FlightPlanT, LayoutT], ABC):
split=split,
refuel=refuel,
nav_from=builder.nav_path(
split.position,
refuel.position,
self.flight.arrival.position,
self.doctrine.ingress_altitude,
),

View File

@ -105,9 +105,11 @@ class Builder(CapBuilder[TarCapFlightPlan, TarCapLayout]):
start, end = builder.race_track(orbit0p, orbit1p, patrol_alt)
refuel = None
nav_from_origin = orbit1p
if self.package.waypoints is not None:
refuel = builder.refuel(self.package.waypoints.refuel)
nav_from_origin = refuel.position
return TarCapLayout(
departure=builder.takeoff(self.flight.departure),
@ -115,7 +117,7 @@ class Builder(CapBuilder[TarCapFlightPlan, TarCapLayout]):
self.flight.departure.position, orbit0p, patrol_alt
),
nav_from=builder.nav_path(
orbit1p, self.flight.arrival.position, patrol_alt
nav_from_origin, self.flight.arrival.position, patrol_alt
),
patrol_start=start,
patrol_end=end,