Thread: Stuf + Threat
View Single Post
06-10-11, 05:08 AM   #18
Nibelheim
local roygbi-
 
Nibelheim's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 1,600
Hmm, same error again? It must behave different to Pitbull's Lua Text. Maybe it needs an extra return.


Code:
local _, pToken = UnitPowerType(unit)
local pCur, pMax = Power(unit), MaxPower(unit)
if pMax > 0 then
	if pToken == "RAGE" or pToken == "RUNIC_POWER" then
		-- Warrior / Teddy Bear Druid / DK
		if pCur > 0 then
			return "%d", pCur
		end
	else
		-- Everything else
		local pPer = ceil(pCur / pMax)
		if pPer < 100 then
			return "%d", pPer
		end
	end
else
	return ""
end
  Reply With Quote