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
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