mirror of
https://github.com/minetest-mods/areas.git
synced 2024-12-28 03:30:39 +01:00
update player location
update player location when protected
This commit is contained in:
parent
289d0e623c
commit
6cad881b6f
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user