From b10a18c2b63a2032f727029090e410979c9de545 Mon Sep 17 00:00:00 2001 From: Wofsauge Date: Sat, 25 Jan 2025 15:59:59 +0100 Subject: [PATCH] Fixed error caused by entities that dont have an icon assigned to them closes #796 --- features/eid_api.lua | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/features/eid_api.lua b/features/eid_api.lua index 1c7f067e..4a124af7 100644 --- a/features/eid_api.lua +++ b/features/eid_api.lua @@ -1118,7 +1118,9 @@ function EID:createItemIconObject(str) if Type == 1 then return EID:getIcon("Player" .. Sub) elseif Type == 5 then local iconName = EID:GetIconNameByVariant(Var) - return EID:createItemIconObject(iconName .. Sub) + if iconName then + return EID:createItemIconObject(iconName .. Sub) + end end end @@ -2558,7 +2560,9 @@ function EID:getObjectIcon(descObj) if descObj.ObjType == 5 then local iconName = EID:GetIconNameByVariant(descObj.ObjVariant) - return EID:createItemIconObject(iconName .. descObj.ObjSubType) + if iconName then + return EID:createItemIconObject(iconName .. descObj.ObjSubType) + end -- Handle Dice Room Floor elseif descObj.ObjType == 1000 and descObj.ObjVariant == 76 then ---@diagnostic disable-next-line: return-type-mismatch @@ -2737,7 +2741,9 @@ function EID:GetIconStringByDescriptionObject(descObj) return "{{Player" .. (subType or "") .. "}}" elseif descObj.ObjType == 5 then local iconName = EID:GetIconNameByVariant(descObj.ObjVariant) - return "{{" .. iconName .. subType .. "}}" + if iconName then + return "{{" .. iconName .. subType .. "}}" + end elseif descObj.ObjType == 1000 and descObj.ObjVariant == 76 then return "{{DiceFace" .. subType .. "}}" end