Merge pull request #65 from everamzah/fixbones

Try harder to add armor to bones
This commit is contained in:
stujones11 2016-07-22 17:51:06 +01:00 committed by GitHub
commit 456c84e93e

@ -498,16 +498,22 @@ if ARMOR_DROP == true or ARMOR_DESTROY == true then
minetest.after(ARMOR_BONES_DELAY, function() minetest.after(ARMOR_BONES_DELAY, function()
local node = minetest.get_node(vector.round(pos)) local node = minetest.get_node(vector.round(pos))
if node then if node then
if node.name == "bones:bones" then if node.name ~= "bones:bones" then
local meta = minetest.get_meta(vector.round(pos)) pos.y = pos.y+1
local owner = meta:get_string("owner") node = minetest.get_node(vector.round(pos))
local inv = meta:get_inventory() if node.name ~= "bones:bones" then
for _,stack in ipairs(drop) do minetest.log("warning", "Failed to add armor to bones node.")
if name == owner and inv:room_for_item("main", stack) then return
inv:add_item("main", stack) end
else end
armor.drop_armor(pos, stack) local meta = minetest.get_meta(vector.round(pos))
end local owner = meta:get_string("owner")
local inv = meta:get_inventory()
for _,stack in ipairs(drop) do
if name == owner and inv:room_for_item("main", stack) then
inv:add_item("main", stack)
else
armor.drop_armor(pos, stack)
end end
end end
else else