Skip to content

Commit 6b80e90

Browse files
committed
Try to fix querymods.lua rune category inconsistencies
1 parent 92c150c commit 6b80e90

3 files changed

Lines changed: 3904 additions & 3838 deletions

File tree

src/Classes/TradeQueryGenerator.lua

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -510,20 +510,17 @@ return %s
510510
self:ProcessMod(mod, regularItemMask, { ["Wand"] = true, ["Staff"] = true })
511511
else
512512
-- Mod is slot specific, try to match against a value in tradeCategoryNames
513-
local matchedCategory = nil
513+
local matchedCategories = {}
514514
for category, categoryOptions in pairs(tradeCategoryNames) do
515-
for i, opt in pairs(categoryOptions) do
516-
if opt:lower():match("^"..slotType) then
517-
matchedCategory = category
518-
break
515+
for _, opt in ipairs(categoryOptions) do
516+
-- warstaves have inconsistent naming and need special handling
517+
if opt:lower() == slotType or ((opt == "Staff: Warstaff") and (slotType == "warstaff")) then
518+
matchedCategories[category] = true
519519
end
520520
end
521-
if matchedCategory then
522-
break
523-
end
524521
end
525-
if matchedCategory then
526-
self:ProcessMod(mod, regularItemMask, { [matchedCategory] = true })
522+
if next(matchedCategories) then
523+
self:ProcessMod(mod, regularItemMask, matchedCategories)
527524
else
528525
ConPrintf("TradeQuery: Unmatched category for modifier. Slot type: %s Modifier: %s", mods.slotType, mods.name)
529526
end

0 commit comments

Comments
 (0)