WoW:API GetTalentPrereqs: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 43: Line 43:
== Details ==
== Details ==
If you select a talent with no prerequisites, the whole function returns nil
If you select a talent with no prerequisites, the whole function returns nil
The original code by Blizzard shows that possibly several prerequisites could exists, in which case other triplets of row, column, learnable values would be returned. Code to handle this would look like this :
local handle_prereqs = function (...)
  for i = 1, select("#", ...), 3 do
    local row, column, learnable = select(i, ...)
    <do something here>
  end
end
handle_prereqs(GetTalentPrereqs(tab, index))
Anonymous user