Quantcast

Fixed pet updates (for good)

p3lim-52096 [07-15-09 - 18:50]
Fixed pet updates (for good)

git-svn-id: svn://svn.wowinterface.com/oUF_Experience-227/trunk@37 f81be506-7a38-4956-9b9f-d707db2888a5
Filename
oUF_Experience/oUF_Experience.lua
diff --git a/oUF_Experience/oUF_Experience.lua b/oUF_Experience/oUF_Experience.lua
index 5cbb032..82fc775 100644
--- a/oUF_Experience/oUF_Experience.lua
+++ b/oUF_Experience/oUF_Experience.lua
@@ -94,6 +94,12 @@ local function LevelCheck(self)
 	end
 end

+local function PetCheck(self, event, unit)
+	if(unit == 'player') then
+		LevelCheck(self)
+	end
+end
+
 local function Enable(self, unit)
 	local bar = self.Experience
 	if(bar) then
@@ -120,6 +126,7 @@ local function Enable(self, unit)
 			if(select(2, UnitClass('player')) == 'HUNTER') then
 				if(UnitLevel(unit) ~= MAX_PLAYER_LEVEL) then
 					self:RegisterEvent('UNIT_PET_EXPERIENCE', LevelCheck)
+					self:RegisterEvent('UNIT_PET', PetCheck)
 				else
 					bar:Hide()
 				end