mirror of
https://github.com/minetest-mods/3d_armor.git
synced 2025-06-14 15:40:33 +02:00
Fix crash when right-clicking to equip a seventh armor element with a full armor inventory (#163)
This commit is contained in:
parent
a79d1383aa
commit
dbc891a711
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user