From 4668132b37147cb37b15f6a6bb522078e56b5076 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Sun, 9 Jun 2024 18:31:59 +0200 Subject: [PATCH] #GROUP small fix --- Moose Development/Moose/Wrapper/Group.lua | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/Moose Development/Moose/Wrapper/Group.lua b/Moose Development/Moose/Wrapper/Group.lua index 96ac5d87f..4f214c7bf 100644 --- a/Moose Development/Moose/Wrapper/Group.lua +++ b/Moose Development/Moose/Wrapper/Group.lua @@ -1207,15 +1207,17 @@ function GROUP:GetCoordinate() -- no luck, try the API way local DCSGroup = Group.getByName(self.GroupName) - local DCSUnits = DCSGroup:getUnits() or {} - for _,_unit in pairs(DCSUnits) do - if Object.isExist(_unit) then - local position = _unit:getPosition() - local point = position.p ~= nil and position.p or _unit:GetPoint() - if point then - --self:I(point) - local coord = COORDINATE:NewFromVec3(point) - return coord + if DCSGroup then + local DCSUnits = DCSGroup:getUnits() or {} + for _,_unit in pairs(DCSUnits) do + if Object.isExist(_unit) then + local position = _unit:getPosition() + local point = position.p ~= nil and position.p or _unit:GetPoint() + if point then + --self:I(point) + local coord = COORDINATE:NewFromVec3(point) + return coord + end end end end