Skip to content

Commit 7e42d65

Browse files
LocalIdentityLocalIdentity
andauthored
Fix Militant Faith protected nodes not working properly (#9609)
Protected nodes were not strictly enforced. In some cases results included seeds that replaced a protected notable Protected nodes were being handled as just Devotion stats as there was no explicit seed rejection when the jewel data indicated a replacement Co-authored-by: LocalIdentity <localidentity2@gmail.com>
1 parent 206af3b commit 7e42d65

1 file changed

Lines changed: 13 additions & 7 deletions

File tree

src/Classes/TreeTab.lua

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2317,7 +2317,11 @@ function TreeTabClass:FindTimelessJewel()
23172317
else
23182318
local curNode = nil
23192319
local curNodeId = nil
2320-
if (timelessData.jewelType.id == 4 and isValueInTable(protectedNodes, treeData.nodes[targetNode].dn)) then
2320+
if (timelessData.jewelType.id == 4 and isValueInTable(protectedNodes, treeData.nodes[targetNode].dn)) then -- protected
2321+
if jewelDataTbl[1] >= data.timelessJewelAdditions then -- protected node is a replacement, invalidate seed
2322+
resultNodes[curSeed] = nil
2323+
break
2324+
end
23212325
if not desiredNodes["totalStat"] then -- only add if user has not entered their own Devotion to the table
23222326
desiredNodes["totalStat"] = {
23232327
nodeWeight = 0.1, -- keeps total score low to let desired stats decide sort
@@ -2381,7 +2385,7 @@ function TreeTabClass:FindTimelessJewel()
23812385
end
23822386
end
23832387
end
2384-
if desiredNodes["totalStat"] then
2388+
if resultNodes[curSeed] and desiredNodes["totalStat"] then
23852389
resultNodes[curSeed]["totalStat"] = resultNodes[curSeed]["totalStat"] or { targetNodeNames = { }, totalWeight = 0 }
23862390
if timelessData.jewelType.id == 4 then -- Militant Faith
23872391
local addedWeight = desiredNodes["totalStat"].nodeWeight * (5 * targetSmallNodes.otherSmalls + 10 * targetSmallNodes.attributeSmalls)
@@ -2395,11 +2399,13 @@ function TreeTabClass:FindTimelessJewel()
23952399
seedWeights[curSeed] = seedWeights[curSeed] + addedWeight
23962400
end
23972401
end
2398-
-- check minimum weights
2399-
for _, val in ipairs(minimumWeights) do
2400-
if (resultNodes[curSeed][val.reqNode] and resultNodes[curSeed][val.reqNode].totalWeight or 0) < val.weight then
2401-
resultNodes[curSeed] = nil
2402-
break
2402+
if resultNodes[curSeed] then
2403+
-- check minimum weights
2404+
for _, val in ipairs(minimumWeights) do
2405+
if (resultNodes[curSeed][val.reqNode] and resultNodes[curSeed][val.reqNode].totalWeight or 0) < val.weight then
2406+
resultNodes[curSeed] = nil
2407+
break
2408+
end
24032409
end
24042410
end
24052411
end

0 commit comments

Comments
 (0)