Skip to content

Commit 4505401

Browse files
author
LocalIdentity
committed
Fix thorns mod finding logic
1 parent 4ce3362 commit 4505401

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

src/Modules/CalcSetup.lua

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ local t_insert = table.insert
1111
local t_remove = table.remove
1212
local m_min = math.min
1313
local m_max = math.max
14+
local band = AND64
1415

1516
local tempTable1 = { }
1617

@@ -1491,7 +1492,17 @@ function calcs.initEnv(build, mode, override, specEnv)
14911492
end
14921493

14931494
do
1494-
local hasThornsDamage = env.modDB:HasMod("BASE", { flags = ModFlag.Thorns }, "PhysicalMin", "PhysicalMax", "FireMin", "FireMax", "ColdMin", "ColdMax", "LightningMin", "LightningMax", "ChaosMin", "ChaosMax")
1495+
local function modDBHasThornsDamage(modDB)
1496+
for _, stat in ipairs({ "PhysicalMin", "PhysicalMax", "FireMin", "FireMax", "ColdMin", "ColdMax", "LightningMin", "LightningMax", "ChaosMin", "ChaosMax" }) do
1497+
for _, mod in ipairs(modDB.mods[stat] or { }) do
1498+
if mod.type == "BASE" and band(mod.flags or 0, ModFlag.Thorns) ~= 0 then
1499+
return true
1500+
end
1501+
end
1502+
end
1503+
return modDB.parent and modDBHasThornsDamage(modDB.parent)
1504+
end
1505+
local hasThornsDamage = modDBHasThornsDamage(env.modDB)
14951506
if not hasThornsDamage then
14961507
for _, socketGroup in pairs(build.skillsTab.socketGroupList) do
14971508
if socketGroup.source ~= "Thorns" and socketGroup.enabled ~= false then

0 commit comments

Comments
 (0)