Skip to content

Commit

Permalink
FIX: missing source and filter for base mods (PathOfBuildingCommunity…
Browse files Browse the repository at this point in the history
  • Loading branch information
Paliak authored Aug 24, 2023
1 parent 55eb1bf commit 3ac5d3a
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/Modules/CalcDefence.lua
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ function calcs.defence(env, actor)
end
end
if maxRes ~= 0 then
modDB:NewMod(resTo.."ResistMax", "BASE", maxRes * conversionRate)
modDB:NewMod(resTo.."ResistMax", "BASE", maxRes * conversionRate, resFrom.." To "..resTo.." Max Resistance Conversion")
end
end
end
Expand All @@ -340,8 +340,17 @@ function calcs.defence(env, actor)
for _, resTo in ipairs(resistTypeList) do
local conversionRate = modDB:Sum("BASE", nil, resFrom.."ResConvertTo"..resTo) / 100
if conversionRate ~= 0 then
if not res then res = modDB:Sum("BASE", nil, resFrom.."Resist") end
modDB:NewMod(resTo.."Resist", "BASE", res * conversionRate)
if not res then
res = 0
for _, mod in ipairs(modDB:Tabulate("BASE", nil, resFrom.."Resist")) do
if mod.mod.source ~= "Base" then
res = res + mod.value
end
end
end
if res ~= 0 then
modDB:NewMod(resTo.."Resist", "BASE", res * conversionRate, resFrom.." To "..resTo.." Resistance Conversion")
end
end
end
end
Expand Down

0 comments on commit 3ac5d3a

Please sign in to comment.