mirror of
https://github.com/minetest-mods/areas.git
synced 2024-12-22 04:42:23 +01:00
Move areas.hasOwner
This commit is contained in:
parent
1a8efa9916
commit
b40b9d2c39
13
api.lua
13
api.lua
@ -36,16 +36,3 @@ function areas:getNodeOwners(pos)
|
|||||||
return owners
|
return owners
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Checks if an area has an owner
|
|
||||||
function areas.hasOwner(pos)
|
|
||||||
for _, area in pairs(areas.areas) do
|
|
||||||
p1, p2 = area.pos1, area.pos2
|
|
||||||
if pos.x >= p1.x and pos.x <= p2.x and
|
|
||||||
pos.y >= p1.y and pos.y <= p2.y and
|
|
||||||
pos.z >= p1.z and pos.z <= p2.z then
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
|
|
||||||
|
13
legacy.lua
13
legacy.lua
@ -109,6 +109,19 @@ function areas.isNodeOwner(pos, name)
|
|||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Checks if an area has an owner
|
||||||
|
function areas.hasOwner(pos)
|
||||||
|
for _, area in pairs(areas.areas) do
|
||||||
|
p1, p2 = area.pos1, area.pos2
|
||||||
|
if pos.x >= p1.x and pos.x <= p2.x and
|
||||||
|
pos.y >= p1.y and pos.y <= p2.y and
|
||||||
|
pos.z >= p1.z and pos.z <= p2.z then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
IsPlayerNodeOwner = areas.isNodeOwner
|
IsPlayerNodeOwner = areas.isNodeOwner
|
||||||
GetNodeOwnerName = areas.getNodeOwnerName
|
GetNodeOwnerName = areas.getNodeOwnerName
|
||||||
HasOwner = areas.hasOwner
|
HasOwner = areas.hasOwner
|
||||||
|
Loading…
Reference in New Issue
Block a user