Allow DEAD on EWRs.

This commit is contained in:
Dan Albert
2020-11-16 23:47:36 -08:00
parent 082e8c062c
commit 426dc69e1d
2 changed files with 10 additions and 1 deletions

View File

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