mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
If the package does not have a tanker, the refueling task will cause AI flights to go to an arbitrary tanker, which may cause them to fly through enemy territory or even go farther than their arrival airbase. It's also not remotely possible for every AI flight in the game to refuel in most missions. There's typically one tanker and dozens of aircraft that would previously attempt to refuel. Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2716.
13 lines
433 B
Python
13 lines
433 B
Python
from dcs.point import MovingPoint
|
|
from dcs.task import RefuelingTaskAction
|
|
|
|
from game.ato import FlightType
|
|
from .pydcswaypointbuilder import PydcsWaypointBuilder
|
|
|
|
|
|
class RefuelPointBuilder(PydcsWaypointBuilder):
|
|
def add_tasks(self, waypoint: MovingPoint) -> None:
|
|
if self.package.has_flight_with_task(FlightType.REFUELING):
|
|
waypoint.add_task(RefuelingTaskAction())
|
|
return super().add_tasks(waypoint)
|