Remove the bones if emptied

This commit is contained in:
Zheyu Shen 2014-06-21 05:25:39 +00:00
parent 7f3b8f28c5
commit 71e384783f

View file

@ -51,10 +51,8 @@ minetest.register_node("bones:bones", {
on_metadata_inventory_take = function(pos, listname, index, stack, player)
local meta = minetest.get_meta(pos)
if meta:get_string("owner") ~= "" and meta:get_inventory():is_empty("main") then
meta:set_string("infotext", meta:get_string("owner").."'s old bones")
meta:set_string("formspec", "")
meta:set_string("owner", "")
if meta:get_inventory():is_empty("main") then
minetest.remove_node(pos)
end
end,