Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions spec/System/TestTreeTab_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,11 @@ describe("TreeTab", function()
{ effect = 101 },
{ effect = 102 },
},
path = { parentNode, false },
pathParent = parentNode,
pathLen = 2,
x = 10,
y = 20,
}
masteryNode.path[2] = masteryNode

treeTab.build.displayStats = {
{ stat = "Damage", label = "Damage", fmt = ".1f" },
}
Expand Down
20 changes: 12 additions & 8 deletions src/Classes/CalcsTab.lua
Original file line number Diff line number Diff line change
Expand Up @@ -534,10 +534,11 @@ function CalcsTabClass:PowerBuilder()
return not assignedNodeId or assignedNodeId == node.id
end

---@param node Node
local function calculateAddNodePower(power, distance, node, output, buildPathNodes)
if self.powerStat and self.powerStat.stat and not self.powerStat.ignoreForNodes then
power.singleStat = self:CalculatePowerStat(self.powerStat, output, calcBase)
if node.path and not node.ascendancyName then
if node.pathLen and not node.ascendancyName then
newPowerMax.singleStat = m_max(newPowerMax.singleStat, power.singleStat)
power.pathPower = power.singleStat
if distance > 1 then
Expand All @@ -547,7 +548,7 @@ function CalcsTabClass:PowerBuilder()
elseif not self.powerStat or not self.powerStat.ignoreForNodes then
power.offence, power.defence = self:CalculateCombinedOffDefStat(output, calcBase)
power.singleStat = power.offence
if node.path and not node.ascendancyName then
if node.pathLen and not node.ascendancyName then
newPowerMax.offence = m_max(newPowerMax.offence, power.offence)
newPowerMax.defence = m_max(newPowerMax.defence, power.defence)
newPowerMax.offencePerPoint = m_max(newPowerMax.offencePerPoint, power.offence / distance)
Expand Down Expand Up @@ -609,15 +610,18 @@ function CalcsTabClass:PowerBuilder()
break
end
for nodeId, node in pairs(nodes) do
---@cast node Node
if not node.alloc and node.modKey ~= "" and not self.mainEnv.grantedPassives[nodeId] then
if not cache[node.modKey] then
cache[node.modKey] = calcFunc({ addNodes = { [node] = true } }, useFullDPS)
end
local output = cache[node.modKey]
calculateAddNodePower(node.power, distance, node, output, function()
local pathNodes = { }
for _, pathNode in pairs(node.path) do
pathNodes[pathNode] = true
local currentNode = node
while currentNode and currentNode.pathLen > 0 do
pathNodes[currentNode] = true
currentNode = currentNode.pathParent
end
return pathNodes
end)
Expand Down Expand Up @@ -679,10 +683,10 @@ function CalcsTabClass:PowerBuilder()
local pathNodes = {
[effectNode] = true
}
for _, pathNode in pairs(node.path) do
if pathNode ~= node then
pathNodes[pathNode] = true
end
local currentNode = node.pathParent
while currentNode and currentNode.pathLen > 0 do
pathNodes[currentNode] = true
currentNode = currentNode.pathParent
end
return pathNodes
end)
Expand Down
2 changes: 1 addition & 1 deletion src/Classes/CompareTab.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2676,7 +2676,7 @@ function CompareTabClass:ComparePowerBuilder(compareEntry, powerStat, categories
local impact = self.primaryBuild.calcsTab:CalculatePowerStat(powerStat, output, calcBase)
local pathDist = pNode.pathDist or 0
if pathDist == 0 then
pathDist = #(pNode.path or {})
pathDist = pNode.pathLen or 0
if pathDist == 0 then pathDist = 1 end
end
local perPoint = impact / pathDist
Expand Down
1 change: 1 addition & 0 deletions src/Classes/ItemsTab.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4146,6 +4146,7 @@ local function cloneSpecForJewelComparison(spec)
specCopy.allocSubgraphNodes = { }
specCopy.allocExtendedNodes = { }
specCopy.subGraphs = { }
specCopy.neighboursForNode = {}

return specCopy
end
Expand Down
Loading
Loading