update player location

update player location when protected
This commit is contained in:
alexerate 2018-02-05 18:17:53 +01:00
parent 289d0e623c
commit 6cad881b6f

View File

@ -1,7 +1,10 @@
local old_is_protected = minetest.is_protected local old_is_protected = minetest.is_protected
function minetest.is_protected(pos, name) function minetest.is_protected(pos, name)
local player = minetest.get_player_by_name(name)
local playerpos = player:getpos()
if not areas:canInteract(pos, name) then if not areas:canInteract(pos, name) then
player:setpos(playerpos)
return true return true
end end
return old_is_protected(pos, name) return old_is_protected(pos, name)