fix: occupied bank container

This commit is contained in:
Vati
2026-04-15 18:42:51 +04:00
parent 85e837b1bd
commit e57f59dadb
2 changed files with 87 additions and 34 deletions
+14
View File
@@ -2898,6 +2898,20 @@ function Guda_BankBagSlot_OnReceiveDrag(button, bagID)
local purchased = (bankButtonID and bankButtonID <= GetNumBankSlots())
if not purchased then return end
-- If the target bank bag has items, evacuate them before swapping
local numSlots = GetContainerNumSlots(bagID)
local hasItems = false
if numSlots and numSlots > 0 then
for slot = 1, numSlots do
if GetContainerItemInfo(bagID, slot) then hasItems = true; break end
end
end
if hasItems and addon.Modules.BagReplacer then
addon.Modules.BagReplacer:Execute(bagID, invSlot, true)
return -- BagReplacer handles its own UI updates
end
if EquipCursorItem then
EquipCursorItem(invSlot)
elseif PutItemInBag then