View Single Post
01-12-13, 08:40 PM   #2
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Most likely, the list of spell IDs is out of date, so the addon is trying to get info about a spell that doesn't exist.

Also, that code is really inefficient. Change this part:
Code:
			local name = GetSpellInfo(buff)
			local usable, nomana = IsUsableSpell(name)
			if (usable or nomana) then
				self.icon:SetTexture(select(3, GetSpellInfo(buff)))
to this:
Code:
			local name, _, icon = GetSpellInfo(buff)
			local usable, nomana = IsUsableSpell(name)
			print(buff, name, usable, nomana)
			if (usable or nomana) then
				self.icon:SetTexture(icon)
This (a) fixes the glaring inefficiency of calling the same function twice in a row and adding an extra function call for select, and (b) adds a print statement so you can see in the chat frame which spell it's trying to display. When the black box appears, check the chat frame -- you should see a message like "12345 Spell Name 1 nil". Look up "Spell Name" on Wowhead and make sure that the number in the URL matches the "12345" number shown in the message. If it doesn't match, change "12345" in the table to the correct ID.
__________________
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