Follow-up on package refueler

Fixing some bugs that were caused by missing 'mission data' for package-refueling tankers
This commit is contained in:
Raffson 2023-07-07 21:27:42 +02:00
parent af3a80a294
commit 6734b80684
No known key found for this signature in database
GPG Key ID: B0402B2C9B764D99
2 changed files with 9 additions and 2 deletions

View File

@ -31,6 +31,7 @@ from dcs.unitgroup import FlyingGroup
from game.ato import Flight, FlightType
from game.ato.flightplans.aewc import AewcFlightPlan
from game.ato.flightplans.packagerefueling import PackageRefuelingFlightPlan
from game.ato.flightplans.theaterrefueling import TheaterRefuelingFlightPlan
from game.ato.flightwaypointtype import FlightWaypointType
@ -254,7 +255,10 @@ class AircraftBehavior:
def configure_refueling(self, group: FlyingGroup[Any], flight: Flight) -> None:
self.configure_task(flight, group, Refueling)
if not isinstance(flight.flight_plan, TheaterRefuelingFlightPlan):
if not (
isinstance(flight.flight_plan, TheaterRefuelingFlightPlan)
or isinstance(flight.flight_plan, PackageRefuelingFlightPlan)
):
logging.error(
f"Cannot configure racetrack refueling tasks for {flight} because it "
"does not have an racetrack refueling flight plan."

View File

@ -28,6 +28,7 @@ from .aircraftpainter import AircraftPainter
from .flightdata import FlightData
from .waypoints import WaypointGenerator
from ...ato.flightplans.aewc import AewcFlightPlan
from ...ato.flightplans.packagerefueling import PackageRefuelingFlightPlan
from ...ato.flightplans.theaterrefueling import TheaterRefuelingFlightPlan
from ...theater import Fob
@ -194,7 +195,9 @@ class FlightGroupConfigurator:
blue=self.flight.departure.captured,
)
)
elif isinstance(self.flight.flight_plan, TheaterRefuelingFlightPlan):
elif isinstance(
self.flight.flight_plan, TheaterRefuelingFlightPlan
) or isinstance(self.flight.flight_plan, PackageRefuelingFlightPlan):
if self.flight.tacan is None:
tacan = self.tacan_registry.alloc_for_band(
TacanBand.Y, TacanUsage.AirToAir