Skip to content

Commit

Permalink
Fixed error caused by entities that dont have an icon assigned to them
Browse files Browse the repository at this point in the history
closes #796
  • Loading branch information
wofsauge committed Jan 25, 2025
1 parent 3318198 commit b10a18c
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions features/eid_api.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit b10a18c

Please sign in to comment.