Quantcast

in MainPanel:SetProfession(): Added assignment of previous profession if the current one is different.

James D. Callahan III [03-23-10 - 02:44]
in MainPanel:SetProfession(): Added assignment of previous profession if the current one is different.
Filename
Frame.lua
diff --git a/Frame.lua b/Frame.lua
index 1acf5e9..585b28b 100644
--- a/Frame.lua
+++ b/Frame.lua
@@ -1036,6 +1036,8 @@ do
 	local MINING_SPELL = GetSpellInfo(32606)

 	function MainPanel:SetProfession()
+		local prev_profession = self.profession
+
 		if Player.current_prof == MINING_SPELL then
 			self.profession = 11 -- Smelting
 		else
@@ -1046,6 +1048,10 @@ do
 				end
 			end
 		end
+
+		if self.profession ~= prev_profession then
+			self.prev_profession = prev_profession
+		end
 		self.mode_button:ChangeTexture(SORTED_PROFESSIONS[self.profession].texture)
 	end
 end