From 031dd2b16ede40e840b655f2792a2088d335015c Mon Sep 17 00:00:00 2001 From: Mickael Cagnion Date: Mon, 30 Nov 2026 09:56:35 +0100 Subject: [PATCH] Keep the bloodline when undoing tree changes Undo states stored the bloodline from a field that is never set, so Ctrl+Z, Ctrl+Y, copying a tree and converting a tree to a newer version all reset the bloodline to None. The allocated bloodline passives stayed allocated without a bloodline, and saving afterwards wrote no bloodline to the build. Undo states now store the selected bloodline. --- spec/System/TestTreeTab_spec.lua | 12 ++++++++++++ src/Classes/PassiveSpec.lua | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/spec/System/TestTreeTab_spec.lua b/spec/System/TestTreeTab_spec.lua index 8374496d410..f93f39694e4 100644 --- a/spec/System/TestTreeTab_spec.lua +++ b/spec/System/TestTreeTab_spec.lua @@ -100,6 +100,18 @@ describe("TreeTab", function() assert.are.same("Two Hand Mastery: Gain 10 Damage", report[2].name) end) + it("restores the bloodline on redo", function() + local spec = build.spec + local bloodlineId = assert(next(spec.tree.alternate_ascendancies)) + spec:ResetUndo() + spec:SelectSecondaryAscendClass(bloodlineId) + spec:AddUndoState() + spec:Undo() + spec:Redo() + + assert.are.equals(bloodlineId, spec.curSecondaryAscendClassId) + end) + describe("CopyTree", function() it("Copies a tree spec with a new name", function() local newTitle = "Copied Tree" diff --git a/src/Classes/PassiveSpec.lua b/src/Classes/PassiveSpec.lua index 89dd9e754a1..d3b24cdc220 100644 --- a/src/Classes/PassiveSpec.lua +++ b/src/Classes/PassiveSpec.lua @@ -2433,7 +2433,7 @@ function PassiveSpecClass:CreateUndoState() return { classId = self.curClassId, ascendClassId = self.curAscendClassId, - secondaryAscendClassId = self.secondaryAscendClassId, + secondaryAscendClassId = self.curSecondaryAscendClassId, hashList = allocNodeIdList, hashOverrides = hashOverridesCopy, masteryEffects = selections,