diff --git a/Libs/DF/fw.lua b/Libs/DF/fw.lua index d9ec1634..547c044e 100644 --- a/Libs/DF/fw.lua +++ b/Libs/DF/fw.lua @@ -4252,9 +4252,11 @@ for _, class in ipairs(CLASS_SORT_ORDER) do local specs = C_ClassInfo.GetAllSpecs(class) specs_per_class[class] = {} for index, spec in ipairs(specs) do - local specInfo = C_ClassInfo.GetSpecInfo(class, spec) + local ok, specInfo = pcall(C_ClassInfo.GetSpecInfo, class, spec) + if ok and specInfo then specs_per_class[index] = specInfo.ID end + end end ---return an array table with the spec ids the class can have @@ -4565,10 +4567,12 @@ for _, class in ipairs(CLASS_SORT_ORDER) do DF.ClassSpecs[class] = {} DF.SpecListByClass[class] = {} for index, spec in ipairs(specs) do - local specInfo = C_ClassInfo.GetSpecInfo(class, spec) + local ok, specInfo = pcall(C_ClassInfo.GetSpecInfo, class, spec) + if ok and specInfo then DF.ClassSpecs[class][specInfo.ID] = true tinsert(DF.SpecListByClass[class], specInfo.ID) end + end end ---return if the specId is a valid spec, it'll return false for specIds from the tutorial area diff --git a/Libs/DF/spells.lua b/Libs/DF/spells.lua index 7df1680f..97864247 100644 --- a/Libs/DF/spells.lua +++ b/Libs/DF/spells.lua @@ -81,9 +81,11 @@ for _, class in ipairs(CLASS_SORT_ORDER) do local specs = C_ClassInfo.GetAllSpecs(class) DF.ClassSpecIds[class] = {} for _, spec in ipairs(specs) do - local specInfo = C_ClassInfo.GetSpecInfo(class, spec) + local ok, specInfo = pcall(C_ClassInfo.GetSpecInfo, class, spec) + if ok and specInfo and specInfo.ID then DF.SpecIds[specInfo.ID] = class DF.ClassSpecIds[specInfo.ID] = true + end end end diff --git a/Libs/LibOpenRaid/GetPlayerInformation.lua b/Libs/LibOpenRaid/GetPlayerInformation.lua index 1c037a5e..f626bebb 100644 --- a/Libs/LibOpenRaid/GetPlayerInformation.lua +++ b/Libs/LibOpenRaid/GetPlayerInformation.lua @@ -484,7 +484,9 @@ for _, class in ipairs(CLASS_SORT_ORDER) do local specs = C_ClassInfo.GetAllSpecs(class) openRaidLib.specAttribute[class] = {} for index, spec in ipairs(specs) do - local specInfo = C_ClassInfo.GetSpecInfo(class, spec) + local ok, specInfo = pcall(C_ClassInfo.GetSpecInfo, class, spec) + if ok and specInfo then openRaidLib.specAttribute[class][specInfo.ID] = Enum.PrimaryStat[specInfo.PrimaryStats[1] or "Strength"] end + end end \ No newline at end of file diff --git a/Libs/LibOpenRaid/ThingsToMantain_Ascension.lua b/Libs/LibOpenRaid/ThingsToMantain_Ascension.lua index ca66d4b1..98934a73 100644 --- a/Libs/LibOpenRaid/ThingsToMantain_Ascension.lua +++ b/Libs/LibOpenRaid/ThingsToMantain_Ascension.lua @@ -150,11 +150,13 @@ LIB_OPEN_RAID_MELEE_SPECS = {} for _, class in ipairs(CLASS_SORT_ORDER) do local specs = C_ClassInfo.GetAllSpecs(class) for _, spec in ipairs(specs) do - local specInfo = C_ClassInfo.GetSpecInfo(class, spec) + local ok, specInfo = pcall(C_ClassInfo.GetSpecInfo, class, spec) + if ok and specInfo then if specInfo.MeleeDPS then LIB_OPEN_RAID_MELEE_SPECS[specInfo.ID] = class end end + end end --tells the duration, requirements and cooldown diff --git a/core/gears.lua b/core/gears.lua index c00e5629..e4327ab6 100644 --- a/core/gears.lua +++ b/core/gears.lua @@ -2705,7 +2705,8 @@ Details.specToTexture = {} for _, class in ipairs(CLASS_SORT_ORDER) do local specs = C_ClassInfo.GetAllSpecs(class) for _, spec in ipairs(specs) do - local specInfo = C_ClassInfo.GetSpecInfo(class, spec) + local ok, specInfo = pcall(C_ClassInfo.GetSpecInfo, class, spec) + if ok and specInfo then local thumbnail if ClassTalentUtil then thumbnail = ClassTalentUtil.GetThumbnailAtlas(class, spec) @@ -2717,6 +2718,7 @@ for _, class in ipairs(CLASS_SORT_ORDER) do Details.textureToSpec[thumbnail] = specInfo.ID Details.specToTexture[specInfo.ID] = thumbnail end + end end --oldschool talent tree diff --git a/functions/profiles.lua b/functions/profiles.lua index 542cb371..cd48cfcc 100644 --- a/functions/profiles.lua +++ b/functions/profiles.lua @@ -962,11 +962,13 @@ for _, class in ipairs(CLASS_SORT_ORDER) do local specs = C_ClassInfo.GetAllSpecs(class) if specs then for _, spec in ipairs(specs) do - local spec_info = C_ClassInfo.GetSpecInfo(class, spec) + local ok, spec_info = pcall(C_ClassInfo.GetSpecInfo, class, spec) + if ok and spec_info then if spec_info then default_profile.class_specs_coords [spec_info.ID] = {AtlasUtil:GetCoords("specicon-"..class.."-"..spec_info.Spec)} end end + end end end diff --git a/functions/spells.lua b/functions/spells.lua index 75bb699a..16297980 100644 --- a/functions/spells.lua +++ b/functions/spells.lua @@ -18,9 +18,11 @@ do for _, class in ipairs(CLASS_SORT_ORDER) do local specs = C_ClassInfo.GetAllSpecs(class) for index, spec in ipairs(specs) do - local specInfo = C_ClassInfo.GetSpecInfo(class, spec) + local ok, specInfo = pcall(C_ClassInfo.GetSpecInfo, class, spec) + if ok and specInfo then _detalhes.SpecIDToClass[specInfo.ID] = class end + end end