Quantcast

Fix an issue where setting a new profile did not change profile on next reload

James Whitehead II [10-15-10 - 08:26]
Fix an issue where setting a new profile did not change profile on next reload
Filename
Clique.lua
diff --git a/Clique.lua b/Clique.lua
index 2cc8ce1..b12b812 100755
--- a/Clique.lua
+++ b/Clique.lua
@@ -515,16 +515,18 @@ function addon:TalentGroupChanged()
     local currentProfile = self.db:GetCurrentProfile()
     local newProfile

-    -- Determine which profile to set, based on talent group
-    self.talentGroup = GetActiveTalentGroup()
-    if self.talentGroup == 1 and self.settings.pri_profileKey then
-        newProfile = self.settings.pri_profileKey
-    elseif self.talentGroup == 2 and self.settings.sec_profileKey then
-        newProfile = self.settings.sec_profileKey
-    end
+    if self.settings.specswap then
+        -- Determine which profile to set, based on talent group
+        self.talentGroup = GetActiveTalentGroup()
+        if self.talentGroup == 1 and self.settings.pri_profileKey then
+            newProfile = self.settings.pri_profileKey
+        elseif self.talentGroup == 2 and self.settings.sec_profileKey then
+            newProfile = self.settings.sec_profileKey
+        end

-    if newProfile ~= currentProfile and type(newProfile) == "string" then
-        self.db:SetProfile(newProfile)
+        if newProfile ~= currentProfile and type(newProfile) == "string" then
+            self.db:SetProfile(newProfile)
+        end
     end

     self:UpdateEverything()