mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Allow DEAD on EWRs.
This commit is contained in:
parent
082e8c062c
commit
426dc69e1d
@ -27,6 +27,7 @@ from theater import (
|
|||||||
SamGroundObject,
|
SamGroundObject,
|
||||||
TheaterGroundObject,
|
TheaterGroundObject,
|
||||||
)
|
)
|
||||||
|
from theater.theatergroundobject import EwrGroundObject
|
||||||
from .closestairfields import ObjectiveDistanceCache
|
from .closestairfields import ObjectiveDistanceCache
|
||||||
from .flight import Flight, FlightType, FlightWaypoint, FlightWaypointType
|
from .flight import Flight, FlightType, FlightWaypoint, FlightWaypointType
|
||||||
from .traveltime import GroundSpeed, TravelTime
|
from .traveltime import GroundSpeed, TravelTime
|
||||||
@ -919,7 +920,9 @@ class FlightPlanBuilder:
|
|||||||
"""
|
"""
|
||||||
location = self.package.target
|
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=}")
|
logging.exception(f"Invalid Objective Location for DEAD flight {flight=} at {location=}")
|
||||||
raise InvalidObjectiveLocation(flight.flight_type, location)
|
raise InvalidObjectiveLocation(flight.flight_type, location)
|
||||||
|
|
||||||
|
|||||||
@ -291,6 +291,12 @@ class EwrGroundObject(BaseDefenseGroundObject):
|
|||||||
# Prefix the group names with the side color so Skynet can find them.
|
# Prefix the group names with the side color so Skynet can find them.
|
||||||
return f"{self.faction_color}|{super().group_name}"
|
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):
|
class ShipGroundObject(NavalGroundObject):
|
||||||
def __init__(self, name: str, group_id: int, position: Point,
|
def __init__(self, name: str, group_id: int, position: Point,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user