Don't plan BAI targets at dead subgroups.

Fixes https://github.com/Khopa/dcs_liberation/issues/900
This commit is contained in:
Dan Albert 2021-03-13 13:16:10 -08:00
parent 831516c5f5
commit 6200ec8e0e
3 changed files with 5 additions and 3 deletions

View File

@ -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

View File

@ -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

View File

@ -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: