Skip to content

Commit 7da21f6

Browse files
authored
FIX: kalandra's touch stat copying (#8323)
Kalandra's touch ignored item overrides causing the tooltip to only show stat difference when unequipping the copied ring. During filtering of mods an iterator was modified causing some mods to be skipped.
1 parent 086c8ed commit 7da21f6

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

src/Modules/CalcSetup.lua

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -983,19 +983,22 @@ function calcs.initEnv(build, mode, override, specEnv)
983983
if item.shaper or item.elder then
984984
env.itemModDB.multipliers.ShaperOrElderItem = (env.itemModDB.multipliers.ShaperOrElderItem or 0) - 1
985985
end
986-
local otherRing = (slotName == "Ring 1" and build.itemsTab.items[build.itemsTab.orderedSlots[59].selItemId]) or (slotName == "Ring 2" and build.itemsTab.items[build.itemsTab.orderedSlots[58].selItemId])
986+
local otherRing = items[(slotName == "Ring 1" and "Ring 2") or (slotName == "Ring 2" and "Ring 1")]
987987
if otherRing and not otherRing.name:match("Kalandra's Touch") then
988-
local otherRingList = otherRing and copyTable(otherRing.modList or otherRing.slotModList[slot.slotNum]) or {}
989-
for index, mod in ipairs(otherRingList) do
990-
modLib.setSource(mod, item.modSource)
988+
for _, mod in ipairs(otherRing.modList or otherRing.slotModList[slot.slotNum] or {}) do
989+
-- Filter out SocketedIn type mods
991990
for _, tag in ipairs(mod) do
992991
if tag.type == "SocketedIn" then
993-
otherRingList[index] = nil
994-
break
992+
goto skip_mod
995993
end
996994
end
995+
996+
local modCopy = copyTable(mod)
997+
modLib.setSource(modCopy, item.modSource)
998+
env.itemModDB:ScaleAddMod(modCopy, scale)
999+
1000+
::skip_mod::
9971001
end
998-
env.itemModDB:ScaleAddList(otherRingList, scale)
9991002
-- Adjust multipliers based on other ring
10001003
for mult, property in pairs({["CorruptedItem"] = "corrupted", ["ShaperItem"] = "shaper", ["ElderItem"] = "elder"}) do
10011004
if otherRing[property] then

0 commit comments

Comments
 (0)