Track only set items

Roland Solymosi [06-29-20 - 10:24]
Track only set items
Filename
Internals/Dependencies.lua
Internals/Functions/Callbacks.lua
diff --git a/Internals/Dependencies.lua b/Internals/Dependencies.lua
index ec1615d..d02b528 100644
--- a/Internals/Dependencies.lua
+++ b/Internals/Dependencies.lua
@@ -5,7 +5,6 @@ Dependencies.LibSavedVars = LibSavedVars -- https://www.esoui.com/downloads/info
 Dependencies.LibMainMenu = LibMainMenu2 -- https://cdn.esoui.com/downloads/info2118-LibMainMenu-2.0.html
 --Dependencies.LibDialog = LibDialog -- https://www.esoui.com/downloads/info1931-LibDialog-Customconfirmationdialogwith2buttons.html
 Dependencies.LibSets = LibSets -- https://www.esoui.com/downloads/info2241-LibSets.html
-Dependencies.IIfA = IIfA
 if LibDebugLogger ~= nil then
   Dependencies.Logger = LibDebugLogger("MyCollection") -- https://www.esoui.com/downloads/info2275-LibDebugLogger.html
 else
diff --git a/Internals/Functions/Callbacks.lua b/Internals/Functions/Callbacks.lua
index c605bca..d15cbc8 100644
--- a/Internals/Functions/Callbacks.lua
+++ b/Internals/Functions/Callbacks.lua
@@ -10,7 +10,7 @@ local Callbacks = Functions.Callbacks
 function Callbacks.Added(bagId, slotId, item)
     local characterId = Dependencies.Officials.GetCurrentCharacterId()
     local item = Classes.Item.New(characterId, bagId, slotId)
-    if (item ~= nil) then
+    if (item ~= nil and item.setId ~= nil and item.setId ~= 0) then
         Data.Inventory:AddItem(item)
         Data.Collection:AddItem(item)
     end
@@ -26,7 +26,7 @@ end
 function Callbacks.Updated(bagId, slotId, item)
     local characterId = Dependencies.Officials.GetCurrentCharacterId()
     local item = Classes.Item.New(characterId, bagId, slotId)
-    if (item ~= nil) then
+    if (item ~= nil and item.setId ~= nil and item.setId ~= 0) then
         Data.Inventory:AddItem(item)
         Data.Collection:AddItem(item)
     end