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
|
end
|
||||||
|
|
||||||
function Util.IsSpellIdTalent(SpellId)
|
function Util.IsSpellIdTalent(SpellId)
|
||||||
local TalentInfoFuncs = {GetTalentInfo, GetPvpTalentInfo};
|
-- local TalentInfoFuncs = {GetTalentInfo, GetPvpTalentInfo};
|
||||||
|
local TalentInfoFuncs = GetTalentInfo;
|
||||||
|
|
||||||
-- Scan both normal and PvP talents
|
-- 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
|
-- 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 r = 1;
|
||||||
local c = 1;
|
local c = 1;
|
||||||
local TalentSpellID = select(6, TalentInfoFunc(r, c, 1));
|
-- local TalentSpellID = select(6, TalentInfoFunc(r, c, 1));
|
||||||
while (TalentSpellID) do
|
local TalentSpellID = select(6, TalentInfoFuncs(r, c));
|
||||||
while (TalentSpellID) do
|
while (TalentSpellID <= 0) do
|
||||||
|
while (TalentSpellID <= 0) do
|
||||||
if (TalentSpellID == SpellId) then
|
if (TalentSpellID == SpellId) then
|
||||||
return true;
|
return true;
|
||||||
end
|
end
|
||||||
c = c + 1;
|
c = c + 1;
|
||||||
TalentSpellID = select(6, TalentInfoFunc(r, c, 1));
|
-- TalentSpellID = select(6, TalentInfoFunc(r, c, 1));
|
||||||
|
TalentSpellID = select(6, TalentInfoFuncs(r, c));
|
||||||
end
|
end
|
||||||
r = r + 1;
|
r = r + 1;
|
||||||
c = 1;
|
c = 1;
|
||||||
TalentSpellID = select(6, TalentInfoFunc(r, c, 1));
|
-- TalentSpellID = select(6, TalentInfoFunc(r, c, 1));
|
||||||
end
|
end
|
||||||
end
|
--end
|
||||||
return false;
|
return false;
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Chargement…
Référencer dans un nouveau ticket