summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShadowNinja <shadowninja@minetest.net>2013-11-14 18:26:57 -0500
committerShadowNinja <shadowninja@minetest.net>2013-11-14 18:26:57 -0500
commitb40b9d2c39a602fe779cc7076303407cf3269d4d (patch)
tree253a0ef47d65d33e9c6f8a2d328e2dd69c68cef7
parent1a8efa991661485b32b0c337e1fd1f43506cf16b (diff)
Move areas.hasOwner
-rw-r--r--api.lua13
-rw-r--r--legacy.lua13
2 files changed, 13 insertions, 13 deletions
diff --git a/api.lua b/api.lua
index 1c471e1..9404241 100644
--- a/api.lua
+++ b/api.lua
@@ -36,16 +36,3 @@ function areas:getNodeOwners(pos)
return owners
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
-
diff --git a/legacy.lua b/legacy.lua
index fcad766..6356c38 100644
--- a/legacy.lua
+++ b/legacy.lua
@@ -109,6 +109,19 @@ function areas.isNodeOwner(pos, name)
return false
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
GetNodeOwnerName = areas.getNodeOwnerName
HasOwner = areas.hasOwner