forked from VoxeLibre/VoxeLibre
Create inventory if not present in mcl_armor.equip
This commit is contained in:
parent
dccb71e2fb
commit
74a3b2654f
|
@ -44,7 +44,7 @@ function mcl_armor.equip(itemstack, obj, swap)
|
||||||
end
|
end
|
||||||
|
|
||||||
local element = mcl_armor.elements[def._mcl_armor_element or ""]
|
local element = mcl_armor.elements[def._mcl_armor_element or ""]
|
||||||
local inv = mcl_util.get_inventory(obj)
|
local inv = mcl_util.get_inventory(obj, true)
|
||||||
|
|
||||||
if element and inv then
|
if element and inv then
|
||||||
local old_stack = inv:get_stack("armor", element.index)
|
local old_stack = inv:get_stack("armor", element.index)
|
||||||
|
|
Loading…
Reference in New Issue