Skip to content

Commit e27a8dc

Browse files
committed
Fix crafted mod logic
1 parent 5cb0d97 commit e27a8dc

2 files changed

Lines changed: 1576 additions & 528 deletions

File tree

src/Classes/TradeQueryGenerator.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,9 @@ local function canModSpawnForItemCategory(mod, category)
9191
end
9292
for _, type in ipairs(tradeCategoryNames[category]) do
9393
-- crafted mod
94-
if not mod.weightKey then
95-
return mod.types[category]
96-
else
94+
if mod.types and mod.types[type] then
95+
return true
96+
elseif mod.weightKey then
9797
-- test if item can spawn for any base of the given type
9898
for _, base in ipairs(basesForType[type] or error("missing bases for type " .. type)) do
9999
itemObj.base = base
@@ -902,7 +902,7 @@ function TradeQueryGeneratorClass:FinishQuery()
902902
value = { min = minWeight },
903903
filters = { }
904904
},
905-
requiredMods and {
905+
#requiredMods > 0 and {
906906
type = "and",
907907
filters = {}
908908
}

0 commit comments

Comments
 (0)