View Single Post
12-05-13, 06:41 PM   #5
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Just FYI there is no reason to define variables outside of a loop when they will only be used inside of the loop, and doing it anyway can have unintended consequences depending on what you're using the variables for.

Don't:
Code:
    local icon, count, dispelType, expires, caster, spellID, canApplyAura, isBoss
    for i = 1, 40 do
        _, _, icon, count, dispelType, _, expires, caster, _, _, spellID, canApplyAura, isBoss = UnitDebuff(self.displayedUnit or self.unit, i)
Do:
Code:
    for i = 1, 40 do
       local  _, _, icon, count, dispelType, _, expires, caster, _, _, spellID, canApplyAura, isBoss = UnitDebuff(self.displayedUnit or self.unit, i)
(Also, your code was leaking a global _ variable, which in the past has caused UI-wide breakage. Be careful about any global leakage, but especially _ and other common variable names.)
__________________
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