View Single Post
12-28-14, 09:40 AM   #9
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
The function only processes buffs because it only includes code to process buffs. If you do not pass a filter, UnitAura defaults to looking at buffs. If you want to look at both buffs and debuffs you need to do two loops -- one for buffs, one for debuffs.
Code:
	-- Buffs:
	for i = 1, 40 do
		local name, _, icon, _, dtype, duration, _, _, _, _, id, _, isBossDebuff = UnitAura(unit, i)
		if not name then break end -- no more buffs on this unit
		local priority = list.raidAuras and list.raidAuras[name]
	   	if priority and priority > bestPriority then
			bestPriority = priority
			bestIcon, bestType = icon, dtype
		end
	end
	-- Debuffs:
	for i = 1, 40 do
		local name, _, icon, _, dtype, duration, _, _, _, _, id, _, isBossDebuff = UnitAura(unit, i, "HARMFUL")
		if not name then break end -- no more debuffs on this unit
		local priority = (list.dispel and list.dispel[dtype]) and 5 or (list.raidAuras and list.raidAuras[name])
	   	if priority and priority > bestPriority then
			bestPriority = priority
			bestIcon, bestType = icon, dtype
		end
	end
(Also, I never saw your question, because you just edited your post, and that doesn't flag the thread as unread. Generally if it's been more than 5-10 minutes and your original post didn't including anything that requires a reply, you should just add another post.)
__________________
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.

Last edited by Phanx : 12-28-14 at 09:42 AM.
  Reply With Quote