Skip to content

Commit

Permalink
Fix equipment set filter on retail WoW
Browse files Browse the repository at this point in the history
Co-authored-by: Jens Maier 1 <jens@elberet.de>
  • Loading branch information
doadin and Elberet committed Jul 26, 2024
1 parent ca739ac commit 8b91a76
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/filters/EquipmentSet.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,20 @@ local itemCache = {}

--

local function SafeUnpackItemLocation(packedLoc)
if AddOn:IsRetailWow() then
local player, bank, bags, _, slot, bag = UnpackItemLocation(packedLoc)
return player, bank, bags, slot, bag
else
return UnpackItemLocation(packedLoc)
end
end

local function UpdateItemsCache()
wipe(itemCache)
for _, setId in ipairs(GetEquipmentSetIDs()) do
for _, packedLoc in pairs(GetItemLocations(setId)) do
local player, bank, bags, slot, bag = UnpackItemLocation(packedLoc)
-- NOTE: unlike documented, this method in Cataclysm Classic
-- no longer returns the voidstorage field between bags and slot.
-- TODO: requires additional testing on retail!
local player, bank, bags, slot, bag = SafeUnpackItemLocation(packedLoc)

if bank then
bag = BANK_CONTAINER
Expand Down

0 comments on commit 8b91a76

Please sign in to comment.