Statistics: Posted by asimov59 — 30 Dec 2015, 15:54
local units = import('/mods/common/units.lua')
function getUnitsInRect(x0, z0, x1,z1)
local inRect = {}
local pos, x, z = {}, 0, 0
for _,u in units.Get() do
pos = u:GetPosition()
x, z = pos[1], pos[3]
if (x >= x0) and (x <= x1) and (z >= z0) and (z <= z1) then
table.insert(inRect, u)
end
end
return inRect
end
requires = {"zcbf6277-24e3-437a-b968-Common-v1"}
Statistics: Posted by Myxir — 30 Dec 2015, 15:18
Statistics: Posted by asimov59 — 30 Dec 2015, 15:00
Statistics: Posted by Myxir — 30 Dec 2015, 14:21
Statistics: Posted by asimov59 — 30 Dec 2015, 14:17