Initial attempt at fixing escorts

This commit is contained in:
Raffson
2022-10-31 18:19:46 +01:00
parent f2f818acb3
commit 395969a371
5 changed files with 86 additions and 37 deletions

View File

@@ -63,6 +63,7 @@ class Flight(SidcDescribable):
self.start_type = start_type
self.use_custom_loadout = False
self.custom_name = custom_name
self.group_id: int = 0
# Only used by transport missions.
self.cargo = cargo

View File

@@ -129,6 +129,16 @@ class Package:
if not self.flights:
self.waypoints = None
@property
def primary_flight(self) -> Optional[Flight]:
task = self.primary_task
if not task:
return None
primaries = [x for x in self.flights if x.flight_type == task]
if len(primaries) > 0:
return primaries[0]
return None
@property
def primary_task(self) -> Optional[FlightType]:
if not self.flights: