diff --git a/changelog.md b/changelog.md index 333e32ae..c4a7a8aa 100644 --- a/changelog.md +++ b/changelog.md @@ -9,6 +9,7 @@ Saves from 2.4 are not compatible with 2.5. ## Fixes * **[Flight Planner]** Front lines now project threat zones, so TARCAP/escorts will not be pruned for flights near the front. Packages may also route around the front line when practical. +* **[Flight Planner]** Fixed error when planning BAI at SAMs with dead subgroups. # 2.4.3 diff --git a/gen/flights/flightplan.py b/gen/flights/flightplan.py index 431135d7..a60b5d0c 100644 --- a/gen/flights/flightplan.py +++ b/gen/flights/flightplan.py @@ -1013,7 +1013,8 @@ class FlightPlanBuilder: targets: List[StrikeTarget] = [] for group in location.groups: - targets.append(StrikeTarget(f"{group.name} at {location.name}", group)) + if group.units: + targets.append(StrikeTarget(f"{group.name} at {location.name}", group)) return self.strike_flightplan( flight, location, FlightWaypointType.INGRESS_BAI, targets diff --git a/gen/flights/waypointbuilder.py b/gen/flights/waypointbuilder.py index 69ffac81..53fad47c 100644 --- a/gen/flights/waypointbuilder.py +++ b/gen/flights/waypointbuilder.py @@ -14,7 +14,7 @@ from typing import ( from dcs.mapping import Point from dcs.unit import Unit -from dcs.unitgroup import VehicleGroup +from dcs.unitgroup import Group, VehicleGroup if TYPE_CHECKING: from game import Game @@ -32,7 +32,7 @@ from .flight import Flight, FlightWaypoint, FlightWaypointType @dataclass(frozen=True) class StrikeTarget: name: str - target: Union[VehicleGroup, TheaterGroundObject, Unit] + target: Union[VehicleGroup, TheaterGroundObject, Unit, Group] class WaypointBuilder: