summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTenPlus1 <kinsellaja@yahoo.com>2016-08-15 19:19:36 +0100
committerTenPlus1 <kinsellaja@yahoo.com>2016-08-15 19:19:36 +0100
commite0546a868b96686bb3b7aa195bb5c71150a9174b (patch)
tree9aed8fcf0e91500b8a110a1f5691491546d6fbed
parent3998db207c8df185572020c7cc2191be24a89bdf (diff)
Only move player 0.8 upwards if in protected area and flip enabled
-rw-r--r--init.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/init.lua b/init.lua
index 69b34c9..1f986ef 100644
--- a/init.lua
+++ b/init.lua
@@ -263,14 +263,14 @@ function minetest.is_protected(pos, digger)
-- invert pitch
player:set_look_vertical(-player:get_look_vertical())
- -- if digging below player, move up 1 block
+ -- if digging below player, move up to avoid falling through hole
local pla_pos = player:getpos()
if pos.y < pla_pos.y then
player:setpos({
x = pla_pos.x,
- y = pla_pos.y + 1,
+ y = pla_pos.y + 0.8,
z = pla_pos.z
})
end
@@ -318,7 +318,7 @@ function protector.check_overlap(itemstack, placer, pointed_thing)
end
if not protector.can_dig(protector.radius * 2, pointed_thing.above,
- placer:get_player_name(), true, 3) then
+ placer:get_player_name(), true, 3) then
minetest.chat_send_player(placer:get_player_name(),
S("Overlaps into above players protected area"))