summaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
authorBrandon <brandon@bremaweb.com>2013-05-30 19:30:46 -0500
committerBrandon <brandon@bremaweb.com>2013-05-30 19:30:46 -0500
commit922023034a847e7f3498123bf198dae523b4ad66 (patch)
tree12d410a6c52f254d2a762c6bd56f11576c0fd5bb /init.lua
parentdf8f0d601e02eee64aa029bb283a23b26c479223 (diff)
added landrush priv so admins can build anywhere
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua11
1 files changed, 9 insertions, 2 deletions
diff --git a/init.lua b/init.lua
index 3e10b11..c1a19ae 100644
--- a/init.lua
+++ b/init.lua
@@ -10,6 +10,8 @@ local chunkSize = 16
local claims = {}
local filename = minetest.get_worldpath().."/landrush-claims"
+minetest.register_privilege("landrush", "Allows player to dig and build anywhere")
+
function landrush.load_claims()
local file = io.open(filename, "r")
if file then
@@ -94,7 +96,12 @@ function landrush.get_owner(pos)
end
end
-function landrush.can_interact(name, pos)
+function landrush.can_interact(name, pos)
+
+ if ( minetest.check_player_privs(name, {landrush=true}) ) then
+ return true
+ end
+
local chunk = landrush.get_chunk(pos)
-- return claims[chunk] == nil or claims[chunk].owner == name or claims[chunk].shared[name]
if ( claims[chunk] == nil ) then
@@ -132,7 +139,7 @@ function landrush.can_interact(name, pos)
return true
end
end
- return claims[chunk].owner == name or claims[chunk].shared[name] -- requires a landrush landclaim to build
+ return claims[chunk].owner == name or claims[chunk].shared[name]
end
landrush.default_place = minetest.item_place