From 2aecea88b06fa750dc65c8a148c6ac2dc05df81d Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Tue, 29 Sep 2020 00:44:09 -0700 Subject: [PATCH] Orient CAP tracks toward the enemy. Pointing the race track 90 degrees away from where the enemy is expected means the radar can't see much. CAP flights normally fly *toward* the expected direction of contact and alternate approaching and retreating legs with their wingman. --- gen/flights/flightplan.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/gen/flights/flightplan.py b/gen/flights/flightplan.py index 45bf2a13..ab22c13d 100644 --- a/gen/flights/flightplan.py +++ b/gen/flights/flightplan.py @@ -189,21 +189,20 @@ class FlightPlanBuilder: closest_airfield.position ) - loc = location.position.point_from_heading( + end = location.position.point_from_heading( heading, random.randint(self.doctrine.cap_min_distance_from_cp, self.doctrine.cap_max_distance_from_cp) ) - radius = random.randint( + diameter = random.randint( self.doctrine.cap_min_track_length, self.doctrine.cap_max_track_length ) - orbit0p = loc.point_from_heading(heading - 90, radius) - orbit1p = loc.point_from_heading(heading + 90, radius) + start = end.point_from_heading(heading - 180, diameter) builder = WaypointBuilder(self.doctrine) builder.ascent(flight.from_cp) - builder.race_track(orbit0p, orbit1p, patrol_alt) + builder.race_track(start, end, patrol_alt) builder.rtb(flight.from_cp) flight.points = builder.build()