FIX: LIST type mods being duplicated (#8977)
Most likely caused by https://github.com/PathOfBuildingCommunity/PathOfBuilding/pull/8862
This commit is contained in:
@@ -45,7 +45,7 @@ function ModListClass:ReplaceModInternal(mod)
|
||||
return false
|
||||
end
|
||||
|
||||
function ModListClass:MergeMod(mod)
|
||||
function ModListClass:MergeMod(mod, skipNonAdditive)
|
||||
if mod.type == "BASE" or mod.type == "INC" or mod.type == "MORE" then
|
||||
for i = 1, #self do
|
||||
if modLib.compareModParams(self[i], mod) then
|
||||
@@ -55,7 +55,9 @@ function ModListClass:MergeMod(mod)
|
||||
end
|
||||
end
|
||||
end
|
||||
self:AddMod(mod)
|
||||
if not skipNonAdditive then
|
||||
self:AddMod(mod)
|
||||
end
|
||||
end
|
||||
|
||||
function ModListClass:AddList(modList)
|
||||
|
||||
@@ -1067,7 +1067,7 @@ function calcs.initEnv(build, mode, override, specEnv)
|
||||
local scaledList = new("ModList")
|
||||
scaledList:ScaleAddList(combinedList, scale)
|
||||
for _, mod in ipairs(scaledList) do
|
||||
combinedList:MergeMod(mod)
|
||||
combinedList:MergeMod(mod, true)
|
||||
end
|
||||
env.itemModDB:AddList(combinedList)
|
||||
elseif item.type == "Boots" and calcLib.mod(env.initialNodeModDB, nil, "EffectOfBonusesFromBoots") ~= 1 then
|
||||
@@ -1079,7 +1079,7 @@ function calcs.initEnv(build, mode, override, specEnv)
|
||||
local scaledList = new("ModList")
|
||||
scaledList:ScaleAddList(combinedList, scale)
|
||||
for _, mod in ipairs(scaledList) do
|
||||
combinedList:MergeMod(mod)
|
||||
combinedList:MergeMod(mod, true)
|
||||
end
|
||||
env.itemModDB:AddList(combinedList)
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user