Skip to content

Commit d0f8883

Browse files
committed
updated for midnight
1 parent 79467dc commit d0f8883

File tree

1 file changed

+6
-16
lines changed

1 file changed

+6
-16
lines changed

data/equipmentsets.lua

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -59,30 +59,20 @@ function equipmentSets:UpdatePreMidnight()
5959
end
6060

6161
-- Midnight implementation (12.0.0+)
62-
-- NOTE: This function will need to be implemented based on the actual API changes in Midnight
62+
-- Uses the new EquipmentManager_GetLocationData() function instead of UnpackLocation
6363
function equipmentSets:UpdateMidnight()
6464
wipe(self.bagAndSlotToSet)
65-
-- TODO: Implement Midnight-specific equipment set API logic
66-
-- The API signature or behavior may have changed in 12.0.0
67-
-- Common changes could include:
68-
-- - Different return values from C_EquipmentSet functions
69-
-- - New location format requiring different unpacking
70-
-- - Additional fields or data structures
71-
-- - Deprecated functions replaced with new ones
72-
73-
-- Placeholder implementation (copy of pre-Midnight for now):
74-
-- Note: Midnight only runs on retail, so no need to handle void bank shifting
7565
local sets = C_EquipmentSet.GetEquipmentSetIDs()
7666
for _, setID in ipairs(sets) do
7767
local setName = C_EquipmentSet.GetEquipmentSetInfo(setID)
7868
local setLocations = C_EquipmentSet.GetItemLocations(setID)
7969
if setLocations ~= nil then
8070
for _, location in pairs(setLocations) do
81-
local _, bank, bags, _, slot, bag = EquipmentManager_UnpackLocation(location)
82-
if (bank or bags) and slot ~= nil and bag ~= nil then
83-
self.bagAndSlotToSet[bag] = self.bagAndSlotToSet[bag] or {}
84-
self.bagAndSlotToSet[bag][slot] = self.bagAndSlotToSet[bag][slot] or {}
85-
table.insert(self.bagAndSlotToSet[bag][slot], setName)
71+
local locationData = EquipmentManager_GetLocationData(location)
72+
if (locationData.isBank or locationData.isBags) and locationData.slot ~= nil and locationData.bag ~= nil then
73+
self.bagAndSlotToSet[locationData.bag] = self.bagAndSlotToSet[locationData.bag] or {}
74+
self.bagAndSlotToSet[locationData.bag][locationData.slot] = self.bagAndSlotToSet[locationData.bag][locationData.slot] or {}
75+
table.insert(self.bagAndSlotToSet[locationData.bag][locationData.slot], setName)
8676
end
8777
end
8878
end

0 commit comments

Comments
 (0)