mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Allow custom mission types
Instead of giving an error when a mission type which was added to the squadron is not defined in the Ai autoplanner db for the aircraft the user should be able to task the aircraft accordingly.
This commit is contained in:
@@ -57,6 +57,9 @@ class AirWing:
|
||||
for squadron in control_point.squadrons:
|
||||
if squadron.can_auto_assign_mission(location, task, size, this_turn):
|
||||
capable_at_base.append(squadron)
|
||||
if squadron.aircraft not in best_aircraft:
|
||||
# If it is not already in the list it should be the last one
|
||||
best_aircraft.append(squadron.aircraft)
|
||||
|
||||
ordered.extend(
|
||||
sorted(
|
||||
@@ -73,11 +76,10 @@ class AirWing:
|
||||
return squadron
|
||||
return None
|
||||
|
||||
@property
|
||||
def available_aircraft_types(self) -> Iterator[AircraftType]:
|
||||
def available_aircraft_for_task(self, task: FlightType) -> Iterator[AircraftType]:
|
||||
for aircraft, squadrons in self.squadrons.items():
|
||||
for squadron in squadrons:
|
||||
if squadron.untasked_aircraft:
|
||||
if squadron.untasked_aircraft and task in squadron.mission_types:
|
||||
yield aircraft
|
||||
break
|
||||
|
||||
|
||||
Reference in New Issue
Block a user