Quantcast

Avoid unit checking and rather hardcode it into layout

Adrian L Lange [12-27-09 - 02:46]
Avoid unit checking and rather hardcode it into layout
Filename
oUF_P3lim.lua
diff --git a/oUF_P3lim.lua b/oUF_P3lim.lua
index 941518f..6667edf 100644
--- a/oUF_P3lim.lua
+++ b/oUF_P3lim.lua
@@ -73,8 +73,6 @@ local function updateCombo(self, event, unit)
 end

 local function updatePower(self, event, unit, bar, minVal, maxVal)
-	if(unit ~= 'target') then return end
-
 	if(maxVal ~= 0) then
 		self.Health:SetHeight(20)
 		bar:Show()
@@ -312,8 +310,6 @@ local function style(self, unit)
 		self.Buffs.initialAnchor = 'TOPLEFT'
 		self.Buffs['growth-y'] = 'DOWN'
 		self.PostCreateAuraIcon = createAura
-
-		self.PostUpdatePower = updatePower
 	end

 	if(unit == 'target') then
@@ -335,6 +331,8 @@ local function style(self, unit)
 		self.CPoints:SetJustifyH('RIGHT')
 		self.CPoints.unit = PlayerFrame.unit
 		self:RegisterEvent('UNIT_COMBO_POINTS', updateCombo)
+
+		self.PostUpdatePower = updatePower
 	end

 	if(unit == 'player') then