Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crash when loading build containing a newer tree #4386

Merged
merged 1 commit into from
Jun 2, 2022
Merged
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
38 changes: 19 additions & 19 deletions src/Modules/Build.lua
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,25 @@ function buildMode:Init(dbFileName, buildName, buildXML, convertBuild)
["Spec"] = self.treeTab,
}

-- Initialise class dropdown
for classId, class in pairs(self.latestTree.classes) do
local ascendancies = {}
-- Initialise ascendancy dropdown
for i = 0, #class.classes do
local ascendClass = class.classes[i]
t_insert(ascendancies, {
label = ascendClass.name,
ascendClassId = i,
})
end
t_insert(self.controls.classDrop.list, {
label = class.name,
classId = classId,
ascendencies = ascendancies,
})
end
table.sort(self.controls.classDrop.list, function(a, b) return a.label < b.label end)

-- so we ran into problems with converted trees, trying to check passive tree routes and also consider thread jewels
-- but we cant check jewel info because items have not been loaded yet, and they come after passives in the xml.
-- the simplest solution seems to be making sure passive trees (which contain jewel sockets) are loaded last.
Expand Down Expand Up @@ -731,25 +750,6 @@ function buildMode:Init(dbFileName, buildName, buildXML, convertBuild)
self.configTab:ImportCalcSettings()
end

-- Initialise class dropdown
for classId, class in pairs(self.latestTree.classes) do
local ascendancies = {}
-- Initialise ascendancy dropdown
for i = 0, #class.classes do
local ascendClass = class.classes[i]
t_insert(ascendancies, {
label = ascendClass.name,
ascendClassId = i,
})
end
t_insert(self.controls.classDrop.list, {
label = class.name,
classId = classId,
ascendencies = ascendancies,
})
end
table.sort(self.controls.classDrop.list, function(a, b) return a.label < b.label end)

-- Build calculation output tables
self.outputRevision = 1
self.calcsTab:BuildOutput()
Expand Down