cdmichaelb / Outfitter

Outfitter - Classic
MIT License
10 stars 23 forks source link

Bank functionality broken #11

Closed fgsfdss closed 2 years ago

fgsfdss commented 4 years ago

'Deposit all items', 'deposit unique items' and 'withdraw items' from and to bank are all not working for me. I tried disabling other addons, tried with different sets, tried installing an older version, nothing seems to fix it. My friend reports it working, so I have no idea what to do.

bsimps3 commented 4 years ago

I also have those features of the bank functionality broken

cdmichaelb commented 4 years ago

I have no ETA on bank issue, it's a big one. I could actually use some help if anyone reading this has lua skills.

darkware commented 4 years ago

Just went over it and don't know why this inconsistency in code / data structure occurs but on the Line 559 in OutfitterEquipment.lua it is trying to get the Item to Bank/Withdraw by the SlotID which isn't always in the table of the item. Changing Line 559: Outfitter:UnequipSlotID(equipmentChange.SlotID, emptyBagSlots, expectedInventoryCache) TO Line 559: Outfitter:UnequipSlotID(equipmentChange.FromLocation, emptyBagSlots, expectedInventoryCache)

seems to have fixed the issue for me. Now the banking functionality works but I haven't been able to test further wheter it might break something else.

cdmichaelb commented 4 years ago

@darkware thanks Ill check this out in the morning. I wracked my brain like crazy trying to figure out why it wouldn't work.

cdmichaelb commented 4 years ago

@darkware can you provide some context to line 559 (before and after), your line doesn't seem to be matching up with mine.

darkware commented 4 years ago

It's at the end of the Outfitter._EquipmentChanges:execute(emptyBagSlots, expectedInventoryCache) function. The last else part. I have noticed an issue with the head item slot the way I've had it solved. Updated version (with more context):

      if swapItems then
            if emptyThenEquip then
                Outfitter:UnequipSlotID(equipmentChange.SlotID, emptyBagSlots, expectedInventoryCache)
            end

            -- Make sure nothing is already being held
            ClearCursor()

            -- Pick up the item and equip it
            Outfitter:PickupItemLocation(equipmentChange.ItemLocation)
            EquipCursorItem(equipmentChange.SlotID)

            -- Update the expected cache
            if expectedInventoryCache then
                expectedInventoryCache:SwapLocationWithInventorySlot(equipmentChange.ItemLocation, equipmentChange.SlotName)
            end

        -- Remove the item
        else
            if equipmentChange.SlotID ~= nil then
                Outfitter:UnequipSlotID(equipmentChange.SlotID, emptyBagSlots, expectedInventoryCache)
            else
                Outfitter:UnequipSlotID(equipmentChange.FromLocation, emptyBagSlots, expectedInventoryCache)
            end
        end
darkware commented 4 years ago

Okay dunno what happened. It actually shows Line 528 now 😅

l8nite commented 4 years ago

Thanks for the fix @darkware - I made that change locally here too and it is working well.

Decaphaze commented 4 years ago

@darkware Is there any way you can upload the file, or we can pass an update for this? I tried replacing the line of text with a copy/paste and I'm getting error's and it seems to have completely broken outfitter.

It's really a nuisance not being able to bank gear sets quickly that I don't need while not raiding :(

cdmichaelb commented 4 years ago

Thanks @darkware I implemented it and tried to break it, seems to be working well. Pushing the update shortly. @Decaphaze