Skip to content

Commit 78d1390

Browse files
authored
Fix: when upconverting between trees, if a Mastery lost a mod from its pool that was allocated it would error (#4765)
1 parent c819a68 commit 78d1390

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/Classes/PassiveSpec.lua

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -852,11 +852,16 @@ function PassiveSpecClass:BuildAllDependsAndPaths()
852852
for id, node in pairs(self.nodes) do
853853
if node.type == "Mastery" and self.masterySelections[id] then
854854
local effect = self.tree.masteryEffects[self.masterySelections[id]]
855-
node.sd = effect.sd
856-
node.allMasteryOptions = false
857-
node.reminderText = { "Tip: Right click to select a different effect" }
858-
self.tree:ProcessStats(node)
859-
self.allocatedMasteryCount = self.allocatedMasteryCount + 1
855+
if effect then
856+
node.sd = effect.sd
857+
node.allMasteryOptions = false
858+
node.reminderText = { "Tip: Right click to select a different effect" }
859+
self.tree:ProcessStats(node)
860+
self.allocatedMasteryCount = self.allocatedMasteryCount + 1
861+
else
862+
self.nodes[id].alloc = false
863+
self.allocNodes[id] = nil
864+
end
860865
elseif node.type == "Mastery" then
861866
self:AddMasteryEffectOptionsToNode(node)
862867
elseif node.type == "Notable" and node.alloc then

0 commit comments

Comments
 (0)