forked from mtcontrib/3d_armor
Fix crash when right-clicking to equip a seventh armor element with a full armor inventory (#163)
This commit is contained in:
@ -694,6 +694,9 @@ armor.equip = function(self, player, itemstack)
|
||||
index = i
|
||||
end
|
||||
end
|
||||
if not index then -- armor inventory is full with other armor elements
|
||||
return itemstack
|
||||
end
|
||||
local stack = itemstack:take_item()
|
||||
armor_inv:set_stack("armor", index, stack)
|
||||
self:run_callbacks("on_equip", player, index, stack)
|
||||
|
Reference in New Issue
Block a user