From acaf44034fb4b4cda7e6232f8b405caf6e1202f3 Mon Sep 17 00:00:00 2001 From: DJSchaffner Date: Sun, 16 Jun 2024 12:46:54 +0200 Subject: [PATCH 1/2] add check for valid id before adding tooltip to it in bag --- ItemRack/ItemRack.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ItemRack/ItemRack.lua b/ItemRack/ItemRack.lua index ffcba35..25468e9 100644 --- a/ItemRack/ItemRack.lua +++ b/ItemRack/ItemRack.lua @@ -451,7 +451,10 @@ function ItemRack.UpdateClassSpecificStuff() end function ItemRack.OnSetBagItem(tooltip, bag, slot) - ItemRack.ListSetsHavingItem(tooltip, ItemRack.GetID(bag, slot)) + local id = ItemRack.GetID(bag, slot) + if id ~= "0" then + ItemRack.ListSetsHavingItem(tooltip, id) + end end function ItemRack.OnSetInventoryItem(tooltip, unit, inv_slot) From 9a32f35ccb1024946770e72268d7795c6d7ef57f Mon Sep 17 00:00:00 2001 From: DJSchaffner Date: Sun, 16 Jun 2024 13:40:51 +0200 Subject: [PATCH 2/2] moved fix to more general location --- ItemRack/ItemRack.lua | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/ItemRack/ItemRack.lua b/ItemRack/ItemRack.lua index 25468e9..84e6d73 100644 --- a/ItemRack/ItemRack.lua +++ b/ItemRack/ItemRack.lua @@ -451,10 +451,7 @@ function ItemRack.UpdateClassSpecificStuff() end function ItemRack.OnSetBagItem(tooltip, bag, slot) - local id = ItemRack.GetID(bag, slot) - if id ~= "0" then - ItemRack.ListSetsHavingItem(tooltip, id) - end + ItemRack.ListSetsHavingItem(tooltip, ItemRack.GetID(bag, slot)) end function ItemRack.OnSetInventoryItem(tooltip, unit, inv_slot) @@ -473,7 +470,7 @@ do return end local same_ids = ItemRack.SameID - if not id or id == 0 then return end + if not id or id == 0 or id == "0" then return end for name, set in pairs(ItemRackUser.Sets) do for _, item in pairs(set.equip) do if same_ids(item, id) then