ascott18 / LibSpellRange-1.0

WoW Addon Lib that provides more robust spell range checking functionality.
https://wow.curseforge.com/projects/libspellrange-1-0
2 stars 4 forks source link

[Bug] LibSpellRange-1.0 need to fix these lines #2

Closed cordankos closed 3 years ago

cordankos commented 3 years ago

What version of TellMeWhen are you using?

v9.0.2

Happen error on v15 LibSpellRange 8707x ...llMeWhen\Lib\LibSpellRange-1.0\LibSpellRange-1.0.lua:40: table index is nil [string "@TellMeWhen\Lib\LibSpellRange-1.0\LibSpellRange-1.0.lua"]:40: in function <...llMeWhen\Lib\LibSpellRange-1.0\LibSpellRange-1.0.lua:38> [string "@TellMeWhen\Lib\LibSpellRange-1.0\LibSpellRange-1.0.lua"]:206: in function <...llMeWhen\Lib\LibSpellRange-1.0\LibSpellRange-1.0.lua:205>

Fix It's lines 77-85 of the LibSpellRange v15

-- Updates spellsByName and spellsByID local function UpdateBook(bookType) local , , offs, numspells = GetSpellTabInfo(4) local max = offs -- The offset of the next tab is the max ID of the previous tab. if numspells == 0 then -- New characters pre level 10 only have 2 tabs. local , , offs, numspells = GetSpellTabInfo(2) max = offs + numspells end

Original code -- Updates spellsByName and spellsByID local function UpdateBook(bookType) local max = 0 for i = 1, GetNumSpellTabs() do local , , offs, numspells, _, specId = GetSpellTabInfo(i) if specId == 0 then max = offs + numspells end end

ascott18 commented 3 years ago

@cordankos Please explain what you were doing when you saw the error and why this is the correct fix.

cordankos commented 3 years ago

Yeah my bad, all good with original tmw