mirror of
https://github.com/minetest-mods/3d_armor.git
synced 2024-12-27 11:10:39 +01:00
Check node is not nil before indexing
This commit is contained in:
parent
3badcea0d9
commit
2b0ce6f63e
@ -506,15 +506,17 @@ if ARMOR_DROP == true or ARMOR_DESTROY == true then
|
|||||||
minetest.after(ARMOR_BONES_DELAY, function()
|
minetest.after(ARMOR_BONES_DELAY, function()
|
||||||
pos = vector.round(pos)
|
pos = vector.round(pos)
|
||||||
local node = minetest.get_node(pos)
|
local node = minetest.get_node(pos)
|
||||||
if node and node.name == "bones:bones" then
|
if node then
|
||||||
local meta = minetest.get_meta(pos)
|
if node.name == "bones:bones" then
|
||||||
local owner = meta:get_string("owner")
|
local meta = minetest.get_meta(pos)
|
||||||
local inv = meta:get_inventory()
|
local owner = meta:get_string("owner")
|
||||||
for _,stack in ipairs(drop) do
|
local inv = meta:get_inventory()
|
||||||
if name == owner and inv:room_for_item("main", stack) then
|
for _,stack in ipairs(drop) do
|
||||||
inv:add_item("main", stack)
|
if name == owner and inv:room_for_item("main", stack) then
|
||||||
else
|
inv:add_item("main", stack)
|
||||||
armor.drop_armor(pos, stack)
|
else
|
||||||
|
armor.drop_armor(pos, stack)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user