mirror of
https://github.com/minetest-mods/areas.git
synced 2025-07-04 09:00:25 +02:00
Merge c876179024
into bfb260d181
This commit is contained in:
2
api.lua
2
api.lua
@ -2,6 +2,7 @@
|
|||||||
-- Returns a list of areas that include the provided position
|
-- Returns a list of areas that include the provided position
|
||||||
function areas:getAreasAtPos(pos)
|
function areas:getAreasAtPos(pos)
|
||||||
local a = {}
|
local a = {}
|
||||||
|
if pos then
|
||||||
local px, py, pz = pos.x, pos.y, pos.z
|
local px, py, pz = pos.x, pos.y, pos.z
|
||||||
for id, area in pairs(self.areas) do
|
for id, area in pairs(self.areas) do
|
||||||
local ap1, ap2 = area.pos1, area.pos2
|
local ap1, ap2 = area.pos1, area.pos2
|
||||||
@ -11,6 +12,7 @@ function areas:getAreasAtPos(pos)
|
|||||||
a[id] = area
|
a[id] = area
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
return a
|
return a
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user