mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Fix easy going CAPs.
Fixes https://github.com/Khopa/dcs_liberation/issues/592 (cherry picked from commit 1ebe367e07898bd09833672fe45c12a6dcbae00a)
This commit is contained in:
parent
db229f25bf
commit
a075e62bad
@ -1,3 +1,9 @@
|
|||||||
|
# 2.3.1
|
||||||
|
|
||||||
|
## Fixes:
|
||||||
|
|
||||||
|
* **[AI]** CAP flights will engage enemies again.
|
||||||
|
|
||||||
# 2.3.0
|
# 2.3.0
|
||||||
|
|
||||||
# Features/Improvements
|
# Features/Improvements
|
||||||
|
|||||||
@ -1756,15 +1756,11 @@ class RaceTrackBuilder(PydcsWaypointBuilder):
|
|||||||
f"{flight_plan_type} does not define a patrol.")
|
f"{flight_plan_type} does not define a patrol.")
|
||||||
return waypoint
|
return waypoint
|
||||||
|
|
||||||
racetrack = ControlledTask(OrbitAction(
|
# NB: It's important that the engage task comes before the orbit task.
|
||||||
altitude=waypoint.alt,
|
# Though they're on the same waypoint, if the orbit task comes first it
|
||||||
pattern=OrbitAction.OrbitPattern.RaceTrack
|
# is their first priority and they will not engage any targets because
|
||||||
))
|
# they're fully focused on orbiting. If the STE task is first, they will
|
||||||
self.set_waypoint_tot(
|
# engage targets if available and orbit if they find nothing to shoot.
|
||||||
waypoint, self.flight.flight_plan.patrol_start_time)
|
|
||||||
racetrack.stop_after_time(
|
|
||||||
int(self.flight.flight_plan.patrol_end_time.total_seconds()))
|
|
||||||
waypoint.add_task(racetrack)
|
|
||||||
|
|
||||||
# TODO: Move the properties of this task into the flight plan?
|
# TODO: Move the properties of this task into the flight plan?
|
||||||
# CAP is the only current user of this so it's not a big deal, but might
|
# CAP is the only current user of this so it's not a big deal, but might
|
||||||
@ -1775,6 +1771,16 @@ class RaceTrackBuilder(PydcsWaypointBuilder):
|
|||||||
waypoint.tasks.append(EngageTargets(max_distance=nm_to_meter(50),
|
waypoint.tasks.append(EngageTargets(max_distance=nm_to_meter(50),
|
||||||
targets=[Targets.All.Air]))
|
targets=[Targets.All.Air]))
|
||||||
|
|
||||||
|
racetrack = ControlledTask(OrbitAction(
|
||||||
|
altitude=waypoint.alt,
|
||||||
|
pattern=OrbitAction.OrbitPattern.RaceTrack
|
||||||
|
))
|
||||||
|
self.set_waypoint_tot(
|
||||||
|
waypoint, self.flight.flight_plan.patrol_start_time)
|
||||||
|
racetrack.stop_after_time(
|
||||||
|
int(self.flight.flight_plan.patrol_end_time.total_seconds()))
|
||||||
|
waypoint.add_task(racetrack)
|
||||||
|
|
||||||
return waypoint
|
return waypoint
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user