summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrandon <brandon@bremaweb.com>2013-08-20 23:27:24 -0500
committerBrandon <brandon@bremaweb.com>2013-08-20 23:27:24 -0500
commita961e4305b02eea11f01e3acf068a42db57018c5 (patch)
treee57a1ab42bdd0e88b845b32c91cfbbddf7a4b4eb
parentbe77ee289e651c1bfcd247701a2e5625bcdba452 (diff)
can't claim below -200
-rw-r--r--init.lua16
1 files changed, 14 insertions, 2 deletions
diff --git a/init.lua b/init.lua
index 156cbe7..8b58cb4 100644
--- a/init.lua
+++ b/init.lua
@@ -78,7 +78,7 @@ function landrush.get_chunk(pos)
local y = 0
if ( pos.y < -200 ) then
- y = -32000
+ y = - 32000
elseif ( pos.y < -60 ) then
y = -200
elseif ( pos.y < 140 ) then
@@ -96,7 +96,9 @@ function landrush.get_chunk_center(pos)
local x = math.floor(pos.x/chunkSize)*chunkSize+7.5
local y = 0
- if ( pos.y < -60 ) then
+ if ( pos.y < -200 ) then
+ y = - 32000
+ elseif ( pos.y < -60 ) then
y = -200
elseif ( pos.y < 120 ) then
y = -30
@@ -117,6 +119,10 @@ end
function landrush.can_interact(name, pos)
+ if ( pos.y < -200 ) then
+ return true
+ end
+
if ( minetest.check_player_privs(name, {landrush=true}) ) then
return true
end
@@ -300,6 +306,12 @@ landrush.load_claims()
on_place = function(itemstack, placer, pointed_thing)
owner = landrush.get_owner(pointed_thing.above)
player = placer:get_player_name()
+
+ if ( pointed_thing.above.y < -200 ) then
+ minetest.chat_send_player(player,"You cannot claim below -200")
+ return itemstack
+ end
+
if owner then
minetest.chat_send_player(player, "This area is already owned by "..owner)
else