From 6cad881b6ff0cb5c67cabdca77ec06ba9f65ccfe Mon Sep 17 00:00:00 2001 From: alexerate <35458285+alexerate@users.noreply.github.com> Date: Mon, 5 Feb 2018 18:17:53 +0100 Subject: [PATCH] update player location update player location when protected --- interact.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/interact.lua b/interact.lua index 2e54800..a0579d1 100644 --- a/interact.lua +++ b/interact.lua @@ -1,7 +1,10 @@ local old_is_protected = minetest.is_protected 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 + player:setpos(playerpos) return true end return old_is_protected(pos, name)