Fixes "#5 Game crash when trying to add spell on buttonforge bar". Thanks to Tyr62 for that fix!

Cette révision appartient à :
dvipid 2019-11-23 10:50:03 -05:00
Parent abbab45918
révision ce1241473c
1 fichiers modifiés avec 11 ajouts et 8 suppressions

Voir le fichier

@ -1655,27 +1655,30 @@ function Util.GetSpellId(NameRank)
end
function Util.IsSpellIdTalent(SpellId)
local TalentInfoFuncs = {GetTalentInfo, GetPvpTalentInfo};
-- local TalentInfoFuncs = {GetTalentInfo, GetPvpTalentInfo};
local TalentInfoFuncs = GetTalentInfo;
-- Scan both normal and PvP talents
-- Note rather than assume number of talents, we just scan till the rows and columns till we hit a nil
for _, TalentInfoFunc in ipairs(TalentInfoFuncs) do
--for _, TalentInfoFunc in ipairs(TalentInfoFuncs) do
local r = 1;
local c = 1;
local TalentSpellID = select(6, TalentInfoFunc(r, c, 1));
while (TalentSpellID) do
while (TalentSpellID) do
-- local TalentSpellID = select(6, TalentInfoFunc(r, c, 1));
local TalentSpellID = select(6, TalentInfoFuncs(r, c));
while (TalentSpellID <= 0) do
while (TalentSpellID <= 0) do
if (TalentSpellID == SpellId) then
return true;
end
c = c + 1;
TalentSpellID = select(6, TalentInfoFunc(r, c, 1));
-- TalentSpellID = select(6, TalentInfoFunc(r, c, 1));
TalentSpellID = select(6, TalentInfoFuncs(r, c));
end
r = r + 1;
c = 1;
TalentSpellID = select(6, TalentInfoFunc(r, c, 1));
-- TalentSpellID = select(6, TalentInfoFunc(r, c, 1));
end
end
--end
return false;
end