diff --git a/gen/flights/flightplan.py b/gen/flights/flightplan.py index be09f3ba..49d4b9f3 100644 --- a/gen/flights/flightplan.py +++ b/gen/flights/flightplan.py @@ -27,6 +27,7 @@ from theater import ( SamGroundObject, TheaterGroundObject, ) +from theater.theatergroundobject import EwrGroundObject from .closestairfields import ObjectiveDistanceCache from .flight import Flight, FlightType, FlightWaypoint, FlightWaypointType from .traveltime import GroundSpeed, TravelTime @@ -919,7 +920,9 @@ class FlightPlanBuilder: """ location = self.package.target - if not isinstance(location, SamGroundObject): + is_ewr = isinstance(location, EwrGroundObject) + is_sam = isinstance(location, SamGroundObject) + if not is_ewr and not is_sam: logging.exception(f"Invalid Objective Location for DEAD flight {flight=} at {location=}") raise InvalidObjectiveLocation(flight.flight_type, location) diff --git a/theater/theatergroundobject.py b/theater/theatergroundobject.py index d13b400c..34f4dcc1 100644 --- a/theater/theatergroundobject.py +++ b/theater/theatergroundobject.py @@ -291,6 +291,12 @@ class EwrGroundObject(BaseDefenseGroundObject): # Prefix the group names with the side color so Skynet can find them. return f"{self.faction_color}|{super().group_name}" + def mission_types(self, for_player: bool) -> Iterator[FlightType]: + from gen.flights.flight import FlightType + if not self.is_friendly(for_player): + yield FlightType.DEAD + yield from super().mission_types(for_player) + class ShipGroundObject(NavalGroundObject): def __init__(self, name: str, group_id: int, position: Point,