From 5818367f2edb509eabf431672e45e9b1a09aa171 Mon Sep 17 00:00:00 2001 From: Raffson Date: Sat, 17 Jun 2023 21:28:33 +0200 Subject: [PATCH] Fine-tune SEAD search point --- game/ato/flightplans/waypointbuilder.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/game/ato/flightplans/waypointbuilder.py b/game/ato/flightplans/waypointbuilder.py index f1ddd38a..2a55f7d0 100644 --- a/game/ato/flightplans/waypointbuilder.py +++ b/game/ato/flightplans/waypointbuilder.py @@ -431,9 +431,12 @@ class WaypointBuilder: # Use the threat range as offset distance to avoid flying all the way to the SAM site assert self.flight.package.waypoints ingress = self.flight.package.waypoints.ingress + ingress2tgt_dist = ingress.distance_to_point(target.position) threat_range = 1.1 * max([x.threat_range for x in target.strike_targets]).meters hdg = target.position.heading_between_point(ingress) - hold = target.position.point_from_heading(hdg, threat_range) + hold = target.position.point_from_heading( + hdg, min(threat_range, ingress2tgt_dist * 0.95) + ) return FlightWaypoint( "SEAD Search",