Fixed bug with interception objectives not validating

This commit is contained in:
Ambroise Garel 2025-07-28 11:03:22 +02:00
parent 1e09e166a5
commit bec9f26fa0

View File

@ -171,13 +171,12 @@ do
if index < 1 or index > #objectives then return end -- Out of bounds if index < 1 or index > #objectives then return end -- Out of bounds
if objectives[index].completed then return end -- Objective already completed if objectives[index].completed then return end -- Objective already completed
if event.id ~= world.event.S_EVENT_DEAD then return end if event.id ~= world.event.S_EVENT_DEAD and event.id ~= world.event.S_EVENT_UNIT_LOST then return end
if not event.initiator then return end if not event.initiator then return end
if objectives[index].isSceneryTarget then if objectives[index].isSceneryTarget then
if Object.getCategory(event.initiator) == Object.Category.SCENERY then if Object.getCategory(event.initiator) == Object.Category.SCENERY then
if DCSEx.math.isSamePoint(event.initiator:getPoint(), objectives[index].point3) then if DCSEx.math.isSamePoint(event.initiator:getPoint(), objectives[index].point3) then
-- markObjectiveAsComplete(index)
timer.scheduleFunction(markObjectiveAsComplete, index, timer.getTime() + 3) timer.scheduleFunction(markObjectiveAsComplete, index, timer.getTime() + 3)
end end
end end