Skip to content

Commit 00391a8

Browse files
Refactor to use DeallocSingleNode when switching multiple choice options (#597)
Fixes a possible crash (#575) when a node `allocMode` is set to `nil`, which breaks generating the modlist in `CalcSetup.lua`
1 parent 842b585 commit 00391a8

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/Classes/PassiveSpec.lua

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -718,9 +718,7 @@ function PassiveSpecClass:AllocNode(node, altPath)
718718
local parent = node.linked[1]
719719
for _, optNode in ipairs(parent.linked) do
720720
if optNode.isMultipleChoiceOption and optNode.alloc and optNode ~= node then
721-
optNode.alloc = false
722-
optNode.allocMode = nil
723-
self.allocNodes[optNode.id] = nil
721+
self:DeallocSingleNode(optNode)
724722
end
725723
end
726724
end

0 commit comments

Comments
 (0)