fix completed in research tab and changed/deleted char will not generate research message

Leandro Silva [03-23-20 - 16:34]
fix completed in research tab and changed/deleted char will not generate research message
Filename
LeoAltholic.lua
LeoAltholic.txt
LeoAltholicInit.lua
LeoAltholic_API.lua
diff --git a/LeoAltholic.lua b/LeoAltholic.lua
index 91e60c5..efebf5a 100644
--- a/LeoAltholic.lua
+++ b/LeoAltholic.lua
@@ -787,9 +787,18 @@ function LeoAltholic.AddToQueue(data)
     table.insert(LeoAltholic.timerQueue, data)
 end

+local function charStillExists(charName)
+    for _, char in pairs(LeoAltholic.GetCharacters()) do
+        if char.bio.name ~= charName then
+            return true
+        end
+    end
+    return false
+end
+
 local function processQueue()
     for i, data in pairs(LeoAltholic.timerQueue) do
-        if not data.announced and GetDiffBetweenTimeStamps(data.time, GetTimeStamp()) <= 0 then
+        if charStillExists(data.charName) and not data.announced and GetDiffBetweenTimeStamps(data.time, GetTimeStamp()) <= 0 then
             if data.charName ~= LeoAltholic.CharName and LeoAltholic.globalData.settings.completedResearch.chat == true then
                 LeoAltholic.log(data.info)
             end
diff --git a/LeoAltholic.txt b/LeoAltholic.txt
index deb28dd..99f0193 100644
--- a/LeoAltholic.txt
+++ b/LeoAltholic.txt
@@ -1,7 +1,7 @@
 ## Title: Leo's Altholic
 ## APIVersion: 100029 100030
-## Version: 1.7.9
-## AddOnVersion: 179
+## Version: 1.7.10
+## AddOnVersion: 1710
 ## Author: |c39B027@LeandroSilva|r
 ## SavedVariables: LeoAltholicSavedVariables LeoAltholicCharVariables
 ## DependsOn: LibFeedback LibAddonMenu-2.0
diff --git a/LeoAltholicInit.lua b/LeoAltholicInit.lua
index e259488..ad04d1c 100644
--- a/LeoAltholicInit.lua
+++ b/LeoAltholicInit.lua
@@ -6,7 +6,7 @@ LeoAltholicToolbarUI = LeoAltholicToolbarUI or {}

 LeoAltholic.name = "LeoAltholic"
 LeoAltholic.displayName = "Leo's Altholic"
-LeoAltholic.version = "1.7.9"
+LeoAltholic.version = "1.7.10"
 LeoAltholic.chatPrefix = "|c39B027" .. LeoAltholic.name .. "|r: "

 LeoAltholic.TAB_BIO = "Bio"
diff --git a/LeoAltholic_API.lua b/LeoAltholic_API.lua
index 9e935a9..cae0f89 100644
--- a/LeoAltholic_API.lua
+++ b/LeoAltholic_API.lua
@@ -141,7 +141,7 @@ function LeoAltholic.GetNumMissingTraitsFor(craft, charName)
     for line = 1, GetNumSmithingResearchLines(craft) do
         local _, _, numTraits = GetSmithingResearchLineInfo(craft, line)
         for trait = 1, numTraits do
-            if not LeoAltholic.CharKnowsTrait(craft, line, trait) then
+            if not LeoAltholic.CharKnowsTrait(craft, line, trait, charName) then
                 missing = missing + 1
             end
         end