mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Avoid scrubbing flights if escorts are unplannable
This commit is contained in:
parent
f8e5a2e38d
commit
d190d23655
@ -133,6 +133,21 @@ class PackageFulfiller:
|
|||||||
threats[EscortType.Sead] = True
|
threats[EscortType.Sead] = True
|
||||||
return threats
|
return threats
|
||||||
|
|
||||||
|
def can_plan_escort(self, type: EscortType) -> bool:
|
||||||
|
if type == EscortType.AirToAir:
|
||||||
|
return self.air_wing_can_plan(FlightType.ESCORT)
|
||||||
|
elif type == EscortType.Sead:
|
||||||
|
for task in [
|
||||||
|
FlightType.SEAD,
|
||||||
|
FlightType.SEAD_ESCORT,
|
||||||
|
FlightType.SEAD_SWEEP,
|
||||||
|
]:
|
||||||
|
if self.air_wing_can_plan(task):
|
||||||
|
return True
|
||||||
|
elif type == EscortType.Refuel:
|
||||||
|
return self.air_wing_can_plan(FlightType.REFUELING)
|
||||||
|
return False
|
||||||
|
|
||||||
def plan_mission(
|
def plan_mission(
|
||||||
self,
|
self,
|
||||||
mission: ProposedMission,
|
mission: ProposedMission,
|
||||||
@ -207,7 +222,9 @@ class PackageFulfiller:
|
|||||||
# This list was generated from the not None set, so this should be
|
# This list was generated from the not None set, so this should be
|
||||||
# impossible.
|
# impossible.
|
||||||
assert escort.escort_type is not None
|
assert escort.escort_type is not None
|
||||||
if needed_escorts[escort.escort_type]:
|
if needed_escorts[escort.escort_type] and self.can_plan_escort(
|
||||||
|
escort.escort_type
|
||||||
|
):
|
||||||
with tracer.trace("Flight planning"):
|
with tracer.trace("Flight planning"):
|
||||||
self.plan_flight(
|
self.plan_flight(
|
||||||
mission, escort, builder, missing_types, purchase_multiplier
|
mission, escort, builder, missing_types, purchase_multiplier
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user