From 841df8df6ed754d796896c50cf5905fcb919ec25 Mon Sep 17 00:00:00 2001 From: Qlonever <42286723+Qlonever@users.noreply.github.com> Date: Fri, 14 Aug 2026 15:13:53 -0400 Subject: [PATCH] don't overwrite lockpick/probe stacks --- scripts/player/base.lua | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/scripts/player/base.lua b/scripts/player/base.lua index dc036fd5..e198a5fb 100644 --- a/scripts/player/base.lua +++ b/scripts/player/base.lua @@ -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