Quantcast

Fixed loading issues with pet

p3lim-52096 [06-01-09 - 09:52]
Fixed loading issues with pet

git-svn-id: svn://svn.wowinterface.com/oUF_Experience-227/trunk@33 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 2854e7c..a30b2b3 100644
--- a/oUF_Experience/oUF_Experience.lua
+++ b/oUF_Experience/oUF_Experience.lua
@@ -117,9 +117,13 @@ local function Enable(self, unit)
 					bar.Rested:Hide()
 				end
 			end
-		elseif(unit == 'pet' and select(2, UnitClass('player')) == 'HUNTER') then
-			if(UnitLevel(unit) ~= MAX_PLAYER_LEVEL) then
-				self:RegisterEvent('UNIT_PET_EXPERIENCE', LevelCheck)
+		elseif(unit == 'pet') then
+			if(select(2, UnitClass('player')) == 'HUNTER') then
+				if(UnitLevel(unit) ~= MAX_PLAYER_LEVEL) then
+					self:RegisterEvent('UNIT_PET_EXPERIENCE', LevelCheck)
+				else
+					bar:Hide()
+				end
 			else
 				bar:Hide()
 			end