#GROUP small fix

This commit is contained in:
Applevangelist 2024-06-09 18:31:59 +02:00
parent ceb77e2837
commit 4668132b37

View File

@ -1207,15 +1207,17 @@ function GROUP:GetCoordinate()
-- no luck, try the API way -- no luck, try the API way
local DCSGroup = Group.getByName(self.GroupName) local DCSGroup = Group.getByName(self.GroupName)
local DCSUnits = DCSGroup:getUnits() or {} if DCSGroup then
for _,_unit in pairs(DCSUnits) do local DCSUnits = DCSGroup:getUnits() or {}
if Object.isExist(_unit) then for _,_unit in pairs(DCSUnits) do
local position = _unit:getPosition() if Object.isExist(_unit) then
local point = position.p ~= nil and position.p or _unit:GetPoint() local position = _unit:getPosition()
if point then local point = position.p ~= nil and position.p or _unit:GetPoint()
--self:I(point) if point then
local coord = COORDINATE:NewFromVec3(point) --self:I(point)
return coord local coord = COORDINATE:NewFromVec3(point)
return coord
end
end end
end end
end end