Update Group.lua

- Added way to get the coordinate of the group
This commit is contained in:
Frank 2025-01-28 20:22:45 +01:00
parent 1b6945e0b0
commit 5f7a4f2bbb

View File

@ -1221,6 +1221,13 @@ end
-- @return Core.Point#COORDINATE The COORDINATE of the GROUP. -- @return Core.Point#COORDINATE The COORDINATE of the GROUP.
function GROUP:GetCoordinate() function GROUP:GetCoordinate()
-- First try to get the 3D vector of the group. This uses
local vec3=self:GetVec3()
if vec3 then
local coord=COORDINATE:NewFromVec3(vec3)
return vec3
end
local Units = self:GetUnits() or {} local Units = self:GetUnits() or {}
for _,_unit in pairs(Units) do for _,_unit in pairs(Units) do