diff options
author | Brandon <brandon@bremaweb.com> | 2013-05-30 19:30:46 -0500 |
---|---|---|
committer | Brandon <brandon@bremaweb.com> | 2013-05-30 19:30:46 -0500 |
commit | 922023034a847e7f3498123bf198dae523b4ad66 (patch) | |
tree | 12d410a6c52f254d2a762c6bd56f11576c0fd5bb /init.lua | |
parent | df8f0d601e02eee64aa029bb283a23b26c479223 (diff) |
added landrush priv so admins can build anywhere
Diffstat (limited to 'init.lua')
-rw-r--r-- | init.lua | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -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 |