New release

Leandro Silva [11-11-18 - 08:24]
New release
Filename
LeoGuildManager.lua
LeoGuildManager.txt
LeoGuildManagerInit.lua
diff --git a/LeoGuildManager.lua b/LeoGuildManager.lua
index c558e37..4a447d0 100644
--- a/LeoGuildManager.lua
+++ b/LeoGuildManager.lua
@@ -269,6 +269,34 @@ function LeoGuildManager.CreatePurgeDescription(guildName)
     return descPurge
 end

+local function initGuildScanData(guildName)
+    if LeoGuildManager.scanData[guildName] == nil then
+        LeoGuildManager.scanData[guildName] = {
+            [GUILD_HISTORY_GENERAL] = {
+                firstEvent = 0,
+                lastEvent = 0,
+                events = {}
+            },
+            [GUILD_HISTORY_BANK] = {
+                firstEvent = 0,
+                lastEvent = 0,
+                events = {}
+            },
+            members = {}
+        }
+    end
+end
+
+local function initMemberScanData(guildName, displayName)
+    if LeoGuildManager.scanData[guildName].members[displayName] == nil then
+        LeoGuildManager.scanData[guildName].members[displayName] = {
+            joined = 0,
+            invited = 0,
+            invitedBy = ""
+        }
+    end
+end
+
 local function normalizeGuilds()
     for name, data in pairs(LeoGuildManager.globalData.settings.guilds) do
         local deleted = true
@@ -281,6 +309,7 @@ local function normalizeGuilds()
         if deleted then
             LeoGuildManager.log("Not part of guild " .. name .." anymore. Deleting ...")
             LeoGuildManager.globalData.settings.guilds[name] = nil
+            LeoGuildManager.scanData[name] = nil
         end
     end

@@ -307,6 +336,10 @@ local function normalizeGuilds()
             }
         end
     end
+
+    for _, guildName in pairs(LeoGuildManager.guilds) do
+        initGuildScanData(guildName)
+    end
 end

 function LeoGuildManager.Initialize()
@@ -429,34 +462,6 @@ function ZO_KeyboardGuildRosterRowDisplayName_OnMouseExit(control)
     orig_ZO_KeyboardGuildRosterRowDisplayName_OnMouseExit(control)
 end

-local function initGuildScanData(guildName)
-    if LeoGuildManager.scanData[guildName] == nil then
-        LeoGuildManager.scanData[guildName] = {
-            [GUILD_HISTORY_GENERAL] = {
-                firstEvent = 0,
-                lastEvent = 0,
-                events = {}
-            },
-            [GUILD_HISTORY_BANK] = {
-                firstEvent = 0,
-                lastEvent = 0,
-                events = {}
-            },
-            members = {}
-        }
-    end
-end
-
-local function initMemberScanData(guildName, displayName)
-    if LeoGuildManager.scanData[guildName].members[displayName] == nil then
-        LeoGuildManager.scanData[guildName].members[displayName] = {
-            joined = 0,
-            invited = 0,
-            invitedBy = ""
-        }
-    end
-end
-
 function LeoGuildManager.ProcessEvent(guildId, category, eventIndex)

     local guildName = GetGuildName(guildId)
diff --git a/LeoGuildManager.txt b/LeoGuildManager.txt
index 8857170..99d418e 100644
--- a/LeoGuildManager.txt
+++ b/LeoGuildManager.txt
@@ -1,7 +1,7 @@
 ## Title: Leo's Guild Manager
 ## APIVersion: 100024 100025
-## Version: 1.1.0
-## AddOnVersion: 110
+## Version: 1.1.1
+## AddOnVersion: 111
 ## Author: |c39B027@LeandroSilva|r
 ## SavedVariables: LeoGuildManagerGlobalData LeoGuildManagerScanData
 ## OptionalDependsOn: LibStub LibFeedback LibAddonMenu-2.0
diff --git a/LeoGuildManagerInit.lua b/LeoGuildManagerInit.lua
index 5e522a1..b821acc 100644
--- a/LeoGuildManagerInit.lua
+++ b/LeoGuildManagerInit.lua
@@ -4,7 +4,7 @@ LeoGuildManagerUI = LeoGuildManagerUI or {}

 LeoGuildManager.name = "LeoGuildManager"
 LeoGuildManager.displayName = "Leo's Guild Manager"
-LeoGuildManager.version = "1.1.0"
+LeoGuildManager.version = "1.1.1"
 LeoGuildManager.chatPrefix = "|c39B027" .. LeoGuildManager.name .. "|r: "

 LeoGuildManager.TAB_PURGE = "Purge"