Fix AI landing behavior.

The landing waypoints need the airdrome_id field set to actually
associate with the airfield. Without this ferry flights will take off
and immediately land at their departure airfield.
This commit is contained in:
Dan Albert
2021-08-31 23:03:46 -07:00
parent 1a4be911c0
commit 90a8bb63dc
5 changed files with 28 additions and 2 deletions

View File

@@ -687,6 +687,10 @@ class ControlPoint(MissionTarget, ABC):
) -> RunwayData:
...
@property
def airdrome_id_for_landing(self) -> Optional[int]:
return None
@property
def parking_slots(self) -> Iterator[ParkingSlot]:
yield from []
@@ -904,6 +908,10 @@ class Airfield(ControlPoint):
assigner = RunwayAssigner(conditions)
return assigner.get_preferred_runway(self.airport)
@property
def airdrome_id_for_landing(self) -> Optional[int]:
return self.airport.id
@property
def parking_slots(self) -> Iterator[ParkingSlot]:
yield from self.airport.parking_slots