From 5bfd3bd2cc9e96e707e2041b393de40e9d292f57 Mon Sep 17 00:00:00 2001 From: Giacomo Encicliati Date: Mon, 21 Sep 2026 01:19:03 +0200 Subject: [PATCH] Fix radius jewel functions accumulating across mod list rebuilds ItemClass:BuildModListForSlotNum appends every JewelFunc it finds to self.jewelData.funcList but never clears it, as the `or { }` only creates the table when it is missing. jewelData is reset in BuildModList, which runs when the item is parsed, while the append also runs by way of GetActiveModListForSlotNum, which rebuilds the slot mod lists during calculation whenever the bonded rune state differs from the cached one. Every such rebuild leaves another copy of the jewel's radius functions behind. CalcSetup then creates one radiusJewelList entry per function, and refreshJewelStatCache appends each entry's modifiers into the same per-socket cached list, so a duplicated function applies the jewel's "Passive Skills in Radius also grant" stats one extra time to every node in radius. Building the passive tree power report runs a full calculation pass per node, which multiplies those stats several times over, and the inflated values then survive until the item is reparsed. Rebuild the list from the modifiers found in the current pass instead of appending to whatever was left over. This also stops a jewel from keeping functions it no longer grants after a variant change. --- src/Classes/Item.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Classes/Item.lua b/src/Classes/Item.lua index 3720f43208..408fa00d7f 100644 --- a/src/Classes/Item.lua +++ b/src/Classes/Item.lua @@ -2660,10 +2660,15 @@ function ItemClass:BuildModListForSlotNum(baseList, slotNum) end local jewelData = self.jewelData + -- Rebuild the list from scratch: jewelData is only cleared when the item is reparsed, + -- while this runs again whenever the slot mod list is rebuilt (see GetActiveModListForSlotNum), + -- so appending would apply the jewel's radius functions once more on every rebuild + local funcList = nil for _, func in ipairs(modList:List(nil, "JewelFunc")) do - jewelData.funcList = jewelData.funcList or { } - t_insert(jewelData.funcList, func) + funcList = funcList or { } + t_insert(funcList, func) end + jewelData.funcList = funcList for _, value in ipairs(modList:List(nil, "JewelData")) do jewelData[value.key] = value.value end