View Single Post
09-16-15, 04:22 PM   #3
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Also, you really don't need half those variables you're defining... if you're only going to use a value once, just use it. You don't need to assign one variable's value to another variable before you can use it. I'm also extremely confused about the logic behind doing "-1 * (x - y)" instead of just "y - x" when that's what you really want... o_O

Code:
	for i = 1, 40 do
		local _,_,_,_,_,_,expirationTime,_,_,_id = UnitBuff(u, i)
		if id == 20925 then
			local timeLeft = expirationTime - GetTime()
			if timeLeft > 0.5 then
				return format("|cfffdff52%.0f|r", timeLeft)
			end
		elseif not id then
			-- no more buffs to look at
			return
		end
	end
__________________
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