View Single Post
09-03-14, 05:13 AM   #26
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Since line 1 is blank I assume everything just got shifted down by 1 line when you pasted, and the error is coming from this:

Code:
return a.priority < b.priority or a.priority==b.priority and a.name < b.name
If you're sure all the subtables in your spells table have a priority key, then the issue is probably with spells that don't exist anymore (or yet). I'd just remove them from the table in the previous block:

Code:
    -- get info
    for i = #cfg.spells, 1, -1 do
        local spell = cfg.spells[i]
        spell.name = GetSpellInfo(spell.id)
        if not spell.name then
            print("Spell", spell.id, "doesn't exist!")
            tremove(cfg.spells, i)
        end
    end
Note the reversed iteration order for the loop; this is important since otherwise removing indices inside the loop will cause some entries to be skipped as the indices shift.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote