Fixed error caused by entities that dont have an icon assigned to them
closes #796
This commit is contained in:
1 parent
33181983e7
commit
b10a18c2b6
1 file changed
+6
@@ -1118,9 +1118,11 @@ function EID:createItemIconObject(str)
|
|||||||
if Type == 1 then return EID:getIcon("Player" .. Sub)
|
if Type == 1 then return EID:getIcon("Player" .. Sub)
|
||||||
elseif Type == 5 then
|
elseif Type == 5 then
|
||||||
local iconName = EID:GetIconNameByVariant(Var)
|
local iconName = EID:GetIconNameByVariant(Var)
|
||||||
|
if iconName then
|
||||||
return EID:createItemIconObject(iconName .. Sub)
|
return EID:createItemIconObject(iconName .. Sub)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
---@diagnostic disable
|
---@diagnostic disable
|
||||||
local collID,numReplace = string.gsub(str, "Collectible", "")
|
local collID,numReplace = string.gsub(str, "Collectible", "")
|
||||||
@@ -2558,7 +2560,9 @@ function EID:getObjectIcon(descObj)
|
|||||||
|
|
||||||
if descObj.ObjType == 5 then
|
if descObj.ObjType == 5 then
|
||||||
local iconName = EID:GetIconNameByVariant(descObj.ObjVariant)
|
local iconName = EID:GetIconNameByVariant(descObj.ObjVariant)
|
||||||
|
if iconName then
|
||||||
return EID:createItemIconObject(iconName .. descObj.ObjSubType)
|
return EID:createItemIconObject(iconName .. descObj.ObjSubType)
|
||||||
|
end
|
||||||
-- Handle Dice Room Floor
|
-- Handle Dice Room Floor
|
||||||
elseif descObj.ObjType == 1000 and descObj.ObjVariant == 76 then
|
elseif descObj.ObjType == 1000 and descObj.ObjVariant == 76 then
|
||||||
---@diagnostic disable-next-line: return-type-mismatch
|
---@diagnostic disable-next-line: return-type-mismatch
|
||||||
@@ -2737,7 +2741,9 @@ function EID:GetIconStringByDescriptionObject(descObj)
|
|||||||
return "{{Player" .. (subType or "") .. "}}"
|
return "{{Player" .. (subType or "") .. "}}"
|
||||||
elseif descObj.ObjType == 5 then
|
elseif descObj.ObjType == 5 then
|
||||||
local iconName = EID:GetIconNameByVariant(descObj.ObjVariant)
|
local iconName = EID:GetIconNameByVariant(descObj.ObjVariant)
|
||||||
|
if iconName then
|
||||||
return "{{" .. iconName .. subType .. "}}"
|
return "{{" .. iconName .. subType .. "}}"
|
||||||
|
end
|
||||||
elseif descObj.ObjType == 1000 and descObj.ObjVariant == 76 then
|
elseif descObj.ObjType == 1000 and descObj.ObjVariant == 76 then
|
||||||
return "{{DiceFace" .. subType .. "}}"
|
return "{{DiceFace" .. subType .. "}}"
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in new issue
Block a user