diff --git a/src/Classes/ItemsTab.lua b/src/Classes/ItemsTab.lua index 3eb4af4e..3ea7e433 100644 --- a/src/Classes/ItemsTab.lua +++ b/src/Classes/ItemsTab.lua @@ -3059,7 +3059,10 @@ function ItemsTabClass:AddItemTooltip(tooltip, item, slot, dbMode) for _, compareSlot in pairs(compareSlots) do if not main.slotOnlyTooltips or (slot and (slot.nodeId == compareSlot.nodeId or slot.slotName == compareSlot.slotName)) or not slot or slot == compareSlot then local selItem = self.items[compareSlot.selItemId] + -- short term fix for Time-Lost jewel processing + self.build.treeTab.skipTimeLostJewelProcessing = true local output = calcFunc({ repSlotName = compareSlot.slotName, repItem = item ~= selItem and item or nil}) + self.build.treeTab.skipTimeLostJewelProcessing = false local header if item == selItem then header = "^7Removing this item from "..compareSlot.label.." will give you:" diff --git a/src/Classes/TreeTab.lua b/src/Classes/TreeTab.lua index 05eed819..e1996601 100644 --- a/src/Classes/TreeTab.lua +++ b/src/Classes/TreeTab.lua @@ -31,6 +31,7 @@ local TreeTabClass = newClass("TreeTab", "ControlHost", function(self, build) self.specList[1] = new("PassiveSpec", build, latestTreeVersion) self:SetActiveSpec(1) self:SetCompareSpec(1) + self.skipTimeLostJewelProcessing = false self.anchorControls = new("Control", nil, {0, 0, 0, 20}) diff --git a/src/Modules/CalcSetup.lua b/src/Modules/CalcSetup.lua index b1425913..c0843d18 100644 --- a/src/Modules/CalcSetup.lua +++ b/src/Modules/CalcSetup.lua @@ -142,23 +142,26 @@ local function setRadiusJewelStats(radiusJewel, radiusJewelStats) end local function addStats(jewel, node, spec) - -- reset node stats to base or override for attributes - if spec.hashOverrides and spec.hashOverrides[node.id] then - node.sd = copyTable(spec.hashOverrides[node.id].sd, true) - else - node.sd = copyTable(spec.tree.nodes[node.id].sd, true) - end + -- short term to avoid running the logic on AddItemTooltip + if not spec.build.treeTab.skipTimeLostJewelProcessing then + -- reset node stats to base or override for attributes + if spec.hashOverrides and spec.hashOverrides[node.id] then + node.sd = copyTable(spec.hashOverrides[node.id].sd, true) + else + node.sd = copyTable(spec.tree.nodes[node.id].sd, true) + end - local radiusJewelStats = { } - setRadiusJewelStats(jewel, radiusJewelStats) - for _, stat in ipairs(radiusJewelStats) do - -- the node and stat types match, add sd to node if it's not already there and it's an 'also grant' mod - if not isValueInTable(node.sd, stat.sd) and ((node.type == "Notable" and stat.isNotable) or (node.type == "Normal" and not stat.isNotable)) - and stat.toAdd then - t_insert(node.sd, stat.sd) + local radiusJewelStats = { } + setRadiusJewelStats(jewel, radiusJewelStats) + for _, stat in ipairs(radiusJewelStats) do + -- the node and stat types match, add sd to node if it's not already there and it's an 'also grant' mod + if not isValueInTable(node.sd, stat.sd) and ((node.type == "Notable" and stat.isNotable) or (node.type == "Normal" and not stat.isNotable)) + and stat.toAdd then + t_insert(node.sd, stat.sd) + end end + spec.tree:ProcessStats(node) end - spec.tree:ProcessStats(node) return node.modList end @@ -169,7 +172,7 @@ local function addStatsFromJewelToNode(jewel, node, spec) -- if the Time-Lost jewel is socketed, add the stat if itemsTab.activeSocketList then for _, nodeId in pairs(itemsTab.activeSocketList) do - local _, socketedJewel = itemsTab:GetSocketAndJewelForNodeID(nodeId) + local socketIndex, socketedJewel = itemsTab:GetSocketAndJewelForNodeID(nodeId) if socketedJewel and socketedJewel.baseName:find("Time%-Lost") == 1 then return addStats(jewel, node, spec) end