[Bug] LibSpellRange-1.0 need to fix these lines
cordankos opened this issue ยท 2 comments
**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
@cordankos Please explain what you were doing when you saw the error and why this is the correct fix.