From c2ed1142175d9ce8dc7fa6c8719df3225063e760 Mon Sep 17 00:00:00 2001 From: Ambroise Garel <47314805+akaAgar@users.noreply.github.com> Date: Fri, 25 Jul 2025 18:09:43 +0200 Subject: [PATCH] Refined contact type identification --- Script/The Universal Mission/Wingmen.lua | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Script/The Universal Mission/Wingmen.lua b/Script/The Universal Mission/Wingmen.lua index 5c0b62b..6808c0d 100644 --- a/Script/The Universal Mission/Wingmen.lua +++ b/Script/The Universal Mission/Wingmen.lua @@ -161,9 +161,16 @@ do type = "unknown" } - groupInfo.type = Library.objectNames.getGenericGroup(g, distanceToGroup > detectionRange / 2) - -- if gCateg == Group.Category.AIRPLANE or gCateg == Group.Category.HELICOPTER then - -- end + if gCateg == Group.Category.AIRPLANE or gCateg == Group.Category.HELICOPTER then + if distanceToGroup < detectionRange / 2 then -- Return exact type when aircraft is close enough + groupInfo.type = Library.objectNames.get(g:getUnit(1)) + else + groupInfo.type = Library.objectNames.getGenericGroup(g) + end + else + -- If above 2/3 max detection distance, return imprecise name ("vehicle" instead of "AAA"/"tank"/etc) + groupInfo.type = Library.objectNames.getGenericGroup(g, distanceToGroup > 2 * detectionRange / 3) + end if not newContactsOnly or newGroup then table.insert(detectedTargets, groupInfo)