Skip to content

Commit

Permalink
Fix lua error that got introduced with the latest update
Browse files Browse the repository at this point in the history
  • Loading branch information
Lardeck committed Mar 19, 2023
1 parent a4d5fcf commit d4fab8b
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions ImprovedTalentLoadouts.lua
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ function TalentLoadouts:InitializeCharacterDB()
self.charMacros = ImprovedTalentLoadoutsDB.actionbars.macros.char[playerName]
self.globalMacros = ImprovedTalentLoadoutsDB.actionbars.macros.global
self.specID = PlayerUtil.GetCurrentSpecID()
self:CheckDBIntegrity()
self:CheckForVersionUpdates()
self.initialized = true
self:UpdateMacros()
Expand Down Expand Up @@ -193,13 +194,16 @@ function TalentLoadouts:CheckForVersionUpdates()
local currentVersion = ImprovedTalentLoadoutsDB.version
ImprovedTalentLoadoutsDB.version = internalVersion

for _, categoryInfo in pairs(TalentLoadouts.globalDB.categories[self.specID]) do
if categoryInfo.parents then
local index = tIndexOf(categoryInfo.parents, categoryInfo.key)
if index then
tremove(categoryInfo.parents, index)
if #categoryInfo.parents == 0 then
categoryInfo.isSubCategory = nil
local categories = TalentLoadouts.globalDB.categories[self.specID]
if categories then
for _, categoryInfo in pairs(categories) do
if categoryInfo.parents then
local index = tIndexOf(categoryInfo.parents, categoryInfo.key)
if index then
tremove(categoryInfo.parents, index)
if #categoryInfo.parents == 0 then
categoryInfo.isSubCategory = nil
end
end
end
end
Expand Down

0 comments on commit d4fab8b

Please sign in to comment.