From 7779f0333a296633c8c431ea9556eca11610da58 Mon Sep 17 00:00:00 2001 From: sys4-fr Date: Tue, 21 Mar 2017 22:29:11 +0100 Subject: [PATCH] Fix crash if technic mod is loaded and when a player want to move items from his inventory to a locked chest. --- .../mods/default/functions.lua | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/minetestforfun_game/mods/default/functions.lua b/minetestforfun_game/mods/default/functions.lua index 9cd091b2..a3c5d0eb 100755 --- a/minetestforfun_game/mods/default/functions.lua +++ b/minetestforfun_game/mods/default/functions.lua @@ -487,3 +487,27 @@ function default.intersects_protection(minp, maxp, player_name, interval) return false end + +-- +-- NOTICE: This method is not an official part of the API yet! +-- This method may change in future. +-- + +function default.can_interact_with_node(player, pos) + if player then + if minetest.check_player_privs(player, "protection_bypass") then + return true + end + else + return false + end + + local meta = minetest.get_meta(pos) + local owner = meta:get_string("owner") + + if not owner or owner == "" or owner == player:get_player_name() then + return true + end + + return false +end