diff --git a/changelog.md b/changelog.md index 605b555d..c644f982 100644 --- a/changelog.md +++ b/changelog.md @@ -31,6 +31,7 @@ Saves from 8.x are not compatible with 9.0.0. * **[Mission Generation]** Restored previous AI behavior for anti-ship missions. A DCS update caused only a single aircraft in a flight to attack. The full flight will now attack like they used to. * **[Mission Generation]** Fix generation of OCA Runway missions to allow LGBs to be used. * **[Mission Generation]** Fixed AI flights flying far too slowly toward NAV points. +* **[Mission Generation]** Fixed Recovery Tanker mission type intermittently failing due to not being able to find the CVN. * **[Modding]** Unit variants can now actually override base unit type properties. * **[New Game Wizard]** Factions are reset to default after clicking "Back" to Theater Configuration screen. * **[Plugins]** Fixed Lua errors in Skynet plugin that would occur whenever one coalition had no IADS nodes. diff --git a/game/missiongenerator/aircraft/waypoints/recoverytanker.py b/game/missiongenerator/aircraft/waypoints/recoverytanker.py index f95ea50a..b15bd873 100644 --- a/game/missiongenerator/aircraft/waypoints/recoverytanker.py +++ b/game/missiongenerator/aircraft/waypoints/recoverytanker.py @@ -36,7 +36,11 @@ class RecoveryTankerBuilder(PydcsWaypointBuilder): theater_objects = self.unit_map.theater_objects for key, value in theater_objects.items(): # Check name and position in case there are multiple of same carrier. - if name in key and value.theater_unit.position == carrier_position: + if ( + name in key + and value.theater_unit.position.distance_to_point(carrier_position) + < 1.0 + ): return value.dcs_group_id raise RuntimeError( f"Could not find a carrier in the mission matching {name} at "