Skip to content

Commit dbc891a

Browse files
authored
Fix crash when right-clicking to equip a seventh armor element with a full armor inventory (#163)
1 parent a79d138 commit dbc891a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

3d_armor/api.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,9 @@ armor.equip = function(self, player, itemstack)
694694
index = i
695695
end
696696
end
697+
if not index then -- armor inventory is full with other armor elements
698+
return itemstack
699+
end
697700
local stack = itemstack:take_item()
698701
armor_inv:set_stack("armor", index, stack)
699702
self:run_callbacks("on_equip", player, index, stack)

0 commit comments

Comments
 (0)