mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Don't plan SEAD when only a search radar remains.
This commit is contained in:
parent
1d7b0c9b17
commit
fa321c7ddc
@ -143,11 +143,10 @@ class TheaterGroundObject(MissionTarget):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def has_alive_radar(self) -> bool:
|
def has_live_radar_sam(self) -> bool:
|
||||||
"""Returns True if the ground object contains a unit with radar."""
|
"""Returns True if the ground object contains a unit with working radar SAM."""
|
||||||
for group in self.groups:
|
for group in self.groups:
|
||||||
for unit in group.units:
|
if self.threat_range(group, radar_only=True):
|
||||||
if db.unit_type_from_name(unit.type) in UNITS_WITH_RADAR:
|
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|||||||
@ -628,16 +628,17 @@ class CoalitionMissionPlanner:
|
|||||||
|
|
||||||
# Only include SEAD against SAMs that still have emitters. No need to
|
# Only include SEAD against SAMs that still have emitters. No need to
|
||||||
# suppress an EWR, and SEAD isn't useful against a SAM that no longer has a
|
# suppress an EWR, and SEAD isn't useful against a SAM that no longer has a
|
||||||
# radar.
|
# working track radar.
|
||||||
#
|
#
|
||||||
# For SAMs without radar and EWRs, we still want a SEAD escort if needed.
|
# For SAMs without track radars and EWRs, we still want a SEAD escort if
|
||||||
|
# needed.
|
||||||
#
|
#
|
||||||
# Note that there is a quirk here: we should potentially be included a SEAD
|
# Note that there is a quirk here: we should potentially be included a SEAD
|
||||||
# escort *and* SEAD when the target is a radar SAM but the flight path is
|
# escort *and* SEAD when the target is a radar SAM but the flight path is
|
||||||
# also threatened by SAMs. We don't want to include a SEAD escort if the
|
# also threatened by SAMs. We don't want to include a SEAD escort if the
|
||||||
# package is *only* threatened by the target though. Could be improved, but
|
# package is *only* threatened by the target though. Could be improved, but
|
||||||
# needs a decent refactor to the escort planning to do so.
|
# needs a decent refactor to the escort planning to do so.
|
||||||
if isinstance(sam, SamGroundObject) and sam.has_alive_radar:
|
if sam.has_live_radar_sam:
|
||||||
flights.append(ProposedFlight(FlightType.SEAD, 2, self.MAX_SEAD_RANGE))
|
flights.append(ProposedFlight(FlightType.SEAD, 2, self.MAX_SEAD_RANGE))
|
||||||
else:
|
else:
|
||||||
flights.append(
|
flights.append(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user