Fix an owner bug with constructor, node breaker and other

master
pseudonym-2669 2021-02-28 17:21:51 +00:00 committed by Hume2
parent 9f1314a20a
commit f5f09a3bbf
1 changed files with 4 additions and 4 deletions

View File

@ -86,7 +86,7 @@ function itemframe.rightclick(pos, node, clicker, itemstack)
local owner = meta:get_string("owner")
local admin = minetest.check_player_privs(player_name, "protection_bypass")
if not admin and (player_name ~= owner or not itemstack) then
if not admin and not itemstring == "" then --and (player_name ~= owner or not itemstack) then
return itemstack
end
@ -96,9 +96,9 @@ function itemframe.rightclick(pos, node, clicker, itemstack)
update_item(pos, node)
if itemstring == "" then
meta:set_string("infotext", "Item Frame (owned by " .. owner .. ")")
else
meta:set_string("infotext", itemstring.." (owned by " .. owner .. ")")
if minetest.is_protected(pos, player_name) then return end
meta:set_string("infotext", "Item Frame (owned by " .. player_name .. ")")
meta:set_string("owner", player_name)
end
return itemstack