mirror of
https://notabug.org/TenPlus1/protector.git
synced 2025-01-10 09:27:31 +01:00
Only move player 0.8 upwards if in protected area and flip enabled
This commit is contained in:
parent
3998db207c
commit
e0546a868b
4
init.lua
4
init.lua
@ -263,14 +263,14 @@ function minetest.is_protected(pos, digger)
|
|||||||
-- invert pitch
|
-- invert pitch
|
||||||
player:set_look_vertical(-player:get_look_vertical())
|
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()
|
local pla_pos = player:getpos()
|
||||||
|
|
||||||
if pos.y < pla_pos.y then
|
if pos.y < pla_pos.y then
|
||||||
|
|
||||||
player:setpos({
|
player:setpos({
|
||||||
x = pla_pos.x,
|
x = pla_pos.x,
|
||||||
y = pla_pos.y + 1,
|
y = pla_pos.y + 0.8,
|
||||||
z = pla_pos.z
|
z = pla_pos.z
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user