1
0
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:
EmptyStar 2025-06-06 17:46:28 -05:00 committed by GitHub
parent a79d1383aa
commit dbc891a711
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -694,6 +694,9 @@ armor.equip = function(self, player, itemstack)
index = i index = i
end end
end end
if not index then -- armor inventory is full with other armor elements
return itemstack
end
local stack = itemstack:take_item() local stack = itemstack:take_item()
armor_inv:set_stack("armor", index, stack) armor_inv:set_stack("armor", index, stack)
self:run_callbacks("on_equip", player, index, stack) self:run_callbacks("on_equip", player, index, stack)