Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions scripts/player/base.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1062,9 +1062,16 @@ function BasePlayer:SaveEquipment(playerPacket)
previousItem.refId, previousItem.charge, previousItem.enchantmentCharge)

if inventoryIndex ~= nil then
self.data.inventory[inventoryIndex].count = newCount
self.data.inventory[inventoryIndex].charge = newCharge
self.data.inventory[inventoryIndex].enchantmentCharge = newEnchantmentCharge
-- Players can equip a single lockpick/probe from a stack in their inventory
-- Needs to be separated from the stack when durability changes
if previousItem.charge ~= newCharge and self.data.inventory[inventoryIndex].count > 1 then
self.data.inventory[inventoryIndex].count = self.data.inventory[inventoryIndex].count - 1
table.insert(self.data.inventory, tableHelper.deepCopy(equipmentItem))
else
self.data.inventory[inventoryIndex].count = newCount
self.data.inventory[inventoryIndex].charge = newCharge
self.data.inventory[inventoryIndex].enchantmentCharge = newEnchantmentCharge
end
end
end

Expand Down