Limit squadron tasks to those of the aircraft.

https://github.com/dcs-liberation/dcs_liberation/issues/276
This commit is contained in:
Dan Albert
2021-05-27 20:27:45 -07:00
parent e8edb31be3
commit 1795ed7617
2 changed files with 22 additions and 3 deletions

View File

@@ -426,3 +426,11 @@ def aircraft_for_task(task: FlightType) -> List[Type[FlyingType]]:
else:
logging.error(f"Unplannable flight type: {task}")
return []
def tasks_for_aircraft(aircraft: Type[FlyingType]) -> list[FlightType]:
tasks = []
for task in FlightType:
if aircraft in aircraft_for_task(task):
tasks.append(task)
return tasks