coa.16: Talents view no longer crashes on CoA custom classes
release / release (push) Successful in 5s
release / release (push) Successful in 5s
DataStore_Talents._GetTreeReference degrades to nil (was assert) when a custom class (MONK, etc.) has no/partial talent reference data; Talents.lua skips background render when GetTreeInfo returns no bg.
This commit is contained in:
@@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
## Author: Thaoky, Telkar-RG
|
## Author: Thaoky, Telkar-RG
|
||||||
## X-Edited-By: Exiles (Sub-Net) — florian.berthold@sub-net.at
|
## X-Edited-By: Exiles (Sub-Net) — florian.berthold@sub-net.at
|
||||||
## Version: 3.3.002b-coa.15
|
## Version: 3.3.002b-coa.16
|
||||||
## X-Category: Inventory, Tradeskill, Mail
|
## X-Category: Inventory, Tradeskill, Mail
|
||||||
## X-Localizations: enUS, frFR, zhCN, zhTW, deDE, koKR, esES, esMX, ruRU
|
## X-Localizations: enUS, frFR, zhCN, zhTW, deDE, koKR, esES, esMX, ruRU
|
||||||
## X-Website: http://wow.curse.com/downloads/wow-addons/details/altoholic.aspx
|
## X-Website: http://wow.curse.com/downloads/wow-addons/details/altoholic.aspx
|
||||||
|
|||||||
@@ -337,6 +337,7 @@ function tns:Update(treeIndex)
|
|||||||
|
|
||||||
-- textures are 90.625% of the original size
|
-- textures are 90.625% of the original size
|
||||||
local _, bg = DS:GetTreeInfo(class, treeName)
|
local _, bg = DS:GetTreeInfo(class, treeName)
|
||||||
|
if not bg then return end -- CoA: no talent-tree background for this class (e.g. custom class with no reference data)
|
||||||
AltoholicFrameTalents_bgTopLeft:SetTexture(bg.."-TopLeft")
|
AltoholicFrameTalents_bgTopLeft:SetTexture(bg.."-TopLeft")
|
||||||
AltoholicFrameTalents_bgTopRight:SetTexture(bg.."-TopRight")
|
AltoholicFrameTalents_bgTopRight:SetTexture(bg.."-TopRight")
|
||||||
AltoholicFrameTalents_bgBottomLeft:SetTexture(bg.."-BottomLeft")
|
AltoholicFrameTalents_bgBottomLeft:SetTexture(bg.."-BottomLeft")
|
||||||
|
|||||||
@@ -239,9 +239,12 @@ local function _GetClassReference(class)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function _GetTreeReference(class, tree)
|
local function _GetTreeReference(class, tree)
|
||||||
assert(type(class) == "string")
|
-- CoA: custom classes (MONK, etc.) may have no/partial talent reference data, so a
|
||||||
assert(type(tree) == "string")
|
-- tree lookup can arrive with a nil tree name. Degrade to nil instead of asserting.
|
||||||
return addon.ref.global[class].Trees[tree]
|
if type(class) ~= "string" or type(tree) ~= "string" then return end
|
||||||
|
local c = addon.ref.global[class]
|
||||||
|
if not c or not c.Trees then return end
|
||||||
|
return c.Trees[tree]
|
||||||
end
|
end
|
||||||
|
|
||||||
local function _IsClassKnown(class)
|
local function _IsClassKnown(class)
|
||||||
|
|||||||
Reference in New Issue
Block a user