Quantcast

Return earlier if in a vehicle.

p3lim [12-13-10 - 03:01]
Return earlier if in a vehicle.
Fixes issue #2
Filename
oUF_Experience.lua
diff --git a/oUF_Experience.lua b/oUF_Experience.lua
index a6f0a93..87c3852 100644
--- a/oUF_Experience.lua
+++ b/oUF_Experience.lua
@@ -41,15 +41,17 @@ for tag, func in pairs({
 end

 local function Unbeneficial(self, unit)
+	if(UnitHasVehicleUI('player')) then
+		return true
+	end
+
 	if(unit == 'player') then
 		if(UnitLevel(unit) == MAX_PLAYER_LEVEL) then
 			return true
 		end
 	elseif(unit == 'pet') then
 		local _, hunterPet = HasPetUI()
-		if(not self.disallowVehicleSwap and UnitHasVehicleUI('player')) then
-			return true
-		elseif(not hunterPet or (UnitLevel(unit) == UnitLevel('player'))) then
+		if(not hunterPet or (UnitLevel(unit) == UnitLevel('player'))) then
 			return true
 		end
 	end