Fixes "#5 Game crash when trying to add spell on buttonforge bar". Thanks to Tyr62 for that fix!
Cette révision appartient à :
Parent
abbab45918
révision
ce1241473c
19
Util.lua
19
Util.lua
|
@ -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
|
||||
|
||||
|
|
Chargement…
Référencer dans un nouveau ticket