address issue 3162 by applying threshold to CVN position check

This commit is contained in:
zhexu14 2023-09-23 21:44:57 +10:00 committed by Dan Albert
parent 1ed37ff75e
commit 20574e3fbb
2 changed files with 6 additions and 1 deletions

View File

@ -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.

View File

@ -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 "