Skip to content

Commit 2a40b34

Browse files
author
LocalIdentity
committed
Fix trade query jewel edge cases
Fix Abyss jewels using the wrong category Fix import of Watcher's Eye to use selected socket Avoid emitting false stat groups when no required mods are selected
1 parent e27a8dc commit 2a40b34

2 files changed

Lines changed: 14 additions & 7 deletions

File tree

src/Classes/TradeHelpers.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ function M.getTradeCategory(slotName, item)
301301
elseif slotName == "Amulet" then return "accessory.amulet", "Amulet"
302302
elseif slotName == "Ring 1" or slotName == "Ring 2" or slotName == "Ring 3" then return "accessory.ring", "Ring"
303303
elseif slotName == "Belt" then return "accessory.belt", "Belt"
304-
elseif slotName:find("Abyssal") then return "jewel.abyss", "Jewel"
304+
elseif slotName:find("Abyssal") then return "jewel.abyss", "AbyssJewel"
305305
elseif slotName:find("Jewel") then return "jewel", "Jewel"
306306
elseif slotName:find("Flask") then return "flask", "Flask"
307307
else return nil, nil

src/Classes/TradeQueryGenerator.lua

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -901,16 +901,20 @@ function TradeQueryGeneratorClass:FinishQuery()
901901
type = "weight",
902902
value = { min = minWeight },
903903
filters = { }
904-
},
905-
#requiredMods > 0 and {
906-
type = "and",
907-
filters = {}
908904
}
909905
}
910906
},
911907
sort = { ["statgroup.0"] = "desc" },
912908
engine = "new"
913909
}
910+
local requiredModFilters
911+
if #requiredMods > 0 then
912+
requiredModFilters = {
913+
type = "and",
914+
filters = {}
915+
}
916+
t_insert(queryTable.query.stats, requiredModFilters)
917+
end
914918

915919
local options = self.calcContext.options
916920

@@ -968,8 +972,7 @@ function TradeQueryGeneratorClass:FinishQuery()
968972
end
969973
end
970974
for _, entry in ipairs(requiredMods) do
971-
local filters = queryTable.query.stats[2].filters
972-
t_insert(filters, { id = entry.tradeId, value = { min = entry.value } })
975+
t_insert(requiredModFilters.filters, { id = entry.tradeId, value = { min = entry.value } })
973976
end
974977
if not options.includeMirrored then
975978
queryTable.query.filters.misc_filters = {
@@ -1325,6 +1328,10 @@ Remove: %s will be removed from the search results.]], term, term, term)
13251328
options.requiredMods = copyTable(selectedMods)
13261329
end
13271330
options.statWeights = statWeights
1331+
if controls.jewelSlot then
1332+
slot = controls.jewelSlot:GetSelValue()
1333+
context.slotTbl.selectedJewelNodeId = slot.nodeId
1334+
end
13281335

13291336
self:StartQuery(slot, options)
13301337
end)

0 commit comments

Comments
 (0)