From b343d700a051c19d8e458ad1af3e3f8a4efc484d Mon Sep 17 00:00:00 2001 From: Ambroise Garel <47314805+akaAgar@users.noreply.github.com> Date: Thu, 18 Sep 2025 17:03:19 +0200 Subject: [PATCH] LAND objectives can now only be completed by helicopters, and force removal of target objective group --- Script/The Universal Mission/Objectives.lua | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Script/The Universal Mission/Objectives.lua b/Script/The Universal Mission/Objectives.lua index e8a4992..f4826d4 100644 --- a/Script/The Universal Mission/Objectives.lua +++ b/Script/The Universal Mission/Objectives.lua @@ -182,9 +182,18 @@ do elseif completionEvent == DCSEx.enums.taskEvent.LAND then if event.id ~= world.event.S_EVENT_LAND then return end if Object.getCategory(event.initiator) ~= Object.Category.UNIT then return end - -- TODO: check unit is a helicopter? + if event.initiator:getDesc().category ~= Unit.Category.HELICOPTER then return end if event.initiator:getCoalition() ~= TUM.settings.getPlayerCoalition() then return end if DCSEx.math.getDistance2D(DCSEx.math.vec3ToVec2(event.initiator:getPoint()), objectives[index].point2) > 200 then return end -- Too far from objective + + -- Remove target group if it exists (to simulate it was picked up/captured) + if objectives[index].groupID then + local targetGroup = DCSEx.world.getGroupByID(objectives[index].groupID) + if targetGroup then + targetGroup:destroy() + end + end + timer.scheduleFunction(markObjectiveAsComplete, index, timer.getTime() + 3) updateObjectiveText(index) return