mirror of
https://github.com/luanti-org/minetest_game.git
synced 2025-05-21 14:53:16 -04:00
Remove the bones if emptied
This commit is contained in:
parent
7f3b8f28c5
commit
71e384783f
1 changed files with 2 additions and 4 deletions
|
@ -51,10 +51,8 @@ minetest.register_node("bones:bones", {
|
||||||
|
|
||||||
on_metadata_inventory_take = function(pos, listname, index, stack, player)
|
on_metadata_inventory_take = function(pos, listname, index, stack, player)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
if meta:get_string("owner") ~= "" and meta:get_inventory():is_empty("main") then
|
if meta:get_inventory():is_empty("main") then
|
||||||
meta:set_string("infotext", meta:get_string("owner").."'s old bones")
|
minetest.remove_node(pos)
|
||||||
meta:set_string("formspec", "")
|
|
||||||
meta:set_string("owner", "")
|
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue