respect owner when interacting with nodes in effects

This commit is contained in:
Sokomine 2021-06-12 17:03:38 +02:00
parent 69d29d7aec
commit 0784b86b1d

View File

@ -435,7 +435,17 @@ yl_speak_up.execute_effect = function(player, n_id, o_id, r)
"interaction of type \""..tostring(r.r_value).."\" for NPC.")
return false
end
-- TODO: if node has owner set: check if owner == npc owner
-- if node has owner set: check if owner == npc owner
local meta = minetest.get_meta(r.r_pos)
if(meta
and meta:get_string("owner") and meta:get_string("owner") ~= ""
and meta:get_string("owner") ~= yl_speak_up.npc_owner[ n_id ]) then
yl_speak_up.debug_msg(player, n_id, o_id, tostring(r.r_id).." "..
"block: Blocks at "..pos_str.." is owned by "..meta:get_string("owner")..
". NPC is owned by "..tostring(yl_speak_up.npc_owner[ n_id ])..
" and thus cannot interact with it.")
return false
end
-- "If there is air: Place a block so that it looks like now.", -- 2
if(r.r_value and r.r_value == "place") then
if(is_protected) then