mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Merge pull request #896 from siKruger/aewc_no_threat_zone
if aewc is in threat zone move it further away
This commit is contained in:
commit
49d6cece50
@ -1182,14 +1182,21 @@ class FlightPlanBuilder:
|
|||||||
start = end.point_from_heading(heading - 180, diameter)
|
start = end.point_from_heading(heading - 180, diameter)
|
||||||
return start, end
|
return start, end
|
||||||
|
|
||||||
@staticmethod
|
def aewc_orbit(self, location: MissionTarget) -> Point:
|
||||||
def aewc_orbit(location: MissionTarget) -> Point:
|
# in threat zone
|
||||||
closest_airfield = location
|
if self.threat_zones.threatened(location.position):
|
||||||
# TODO: This is a heading to itself.
|
# Borderpoint
|
||||||
# Place this either over the target or as close as possible outside the
|
closest_boundary = self.threat_zones.closest_boundary(location.position)
|
||||||
# threat zone: https://github.com/Khopa/dcs_liberation/issues/842.
|
|
||||||
heading = location.position.heading_between_point(closest_airfield.position)
|
# Heading + Distance to border point
|
||||||
return location.position.point_from_heading(heading, 5000)
|
heading = location.position.heading_between_point(closest_boundary)
|
||||||
|
distance = location.position.distance_to_point(closest_boundary)
|
||||||
|
|
||||||
|
return location.position.point_from_heading(heading, distance)
|
||||||
|
|
||||||
|
# this Part is fine. No threat zone, just use our point
|
||||||
|
else:
|
||||||
|
return location.position
|
||||||
|
|
||||||
def racetrack_for_frontline(
|
def racetrack_for_frontline(
|
||||||
self, origin: Point, front_line: FrontLine
|
self, origin: Point, front_line: FrontLine
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user