Fix ordering to make sure SavedVars is initialized

Sasky [03-15-15 - 06:30]
Fix ordering to make sure SavedVars is initialized
Filename
CyrHUD.lua
CyrHUD.txt
diff --git a/CyrHUD.lua b/CyrHUD.lua
index 5696bad..cb43f4d 100644
--- a/CyrHUD.lua
+++ b/CyrHUD.lua
@@ -297,14 +297,6 @@ end
 SLASH_COMMANDS["/cyrhud"] = CyrHUD.toggle

 function CyrHUD.playerInit()
-    if IsPlayerInAvAWorld() then
-        if not CyrHUD.visible then
-            CyrHUD.init()
-        end
-    elseif CyrHUD.visible then
-        CyrHUD.deinit()
-    end
-
     if not CyrHUD.initLAM then
         local LAM = LibStub("LibAddonMenu-2.0")
         LAM:RegisterAddonPanel("CyrHUD-LAM", CyrHUD.menuPanel)
@@ -319,6 +311,14 @@ function CyrHUD.playerInit()
         }
         CyrHUD.cfg = ZO_SavedVars:NewAccountWide("CyrHUD_SavedVars", 1.0, "config", def)
     end
+
+    if IsPlayerInAvAWorld() then
+        if not CyrHUD.visible then
+            CyrHUD.init()
+        end
+    elseif CyrHUD.visible then
+        CyrHUD.deinit()
+    end
 end

 EVENT_MANAGER:RegisterForEvent("CyrHUD-init", EVENT_PLAYER_ACTIVATED, CyrHUD.playerInit)
diff --git a/CyrHUD.txt b/CyrHUD.txt
index 6eb604d..90ae68a 100644
--- a/CyrHUD.txt
+++ b/CyrHUD.txt
@@ -1,6 +1,6 @@
 ## APIVersion: 100011
 ## Title: CyrHUD
-## Version: 1.1.1
+## Version: 1.1.2
 ## Author: Sasky
 ## SavedVariables: CyrHUD_SavedVars
 ## OptionalDependsOn: LibAddonMenu-2.0