From c0e7034e00f5bd11f0fb709f133bb432aed8069f Mon Sep 17 00:00:00 2001 From: Wofsauge Date: Fri, 20 Feb 2026 18:14:49 +0100 Subject: [PATCH] fix: Pill names now get evaluated correctly, when ItemNames table entry is present --- features/eid_api.lua | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/features/eid_api.lua b/features/eid_api.lua index 577df302..848e20ea 100644 --- a/features/eid_api.lua +++ b/features/eid_api.lua @@ -1016,8 +1016,7 @@ function EID:getPillName(pillID, isHorsepill) local moddedDesc = EID:getDescriptionEntry("custom", "5.70."..pillID) local legacyModdedDescription = EID:getLegacyModDescription(5, 70, pillID) local tableName = isHorsepill and "horsepills" or "pills" - local translatedName = EID.ItemNames[EID:getLanguage()]["5.70."..pillID] - local defaultDesc = translatedName or EID:getDescriptionEntry(tableName, pillID) + local defaultDesc = EID:getDescriptionEntry(tableName, pillID) local name = moddedDesc or legacyModdedDescription or defaultDesc @@ -1025,10 +1024,16 @@ function EID:getPillName(pillID, isHorsepill) if pillID == 9999 then vanillaName = "Golden Pill" -- only used for languages that haven't defined a Golden Pill name else - vanillaName = EID.itemConfig:GetPillEffect(pillID - 1).Name + if EID.itemConfig:GetPillEffect(pillID - 1) == nil then + return "" + else + vanillaName = EID.itemConfig:GetPillEffect(pillID - 1).Name + end end - name = name and name[2] or (not string.find(vanillaName, "^#") and vanillaName) or EID.descriptions[EID.DefaultLanguageCode][tableName][pillID][2] or vanillaName + local translatedName = EID.ItemNames[EID:getLanguage()]["5.70."..pillID-1] + name = name and name[2] or translatedName or (not string.find(vanillaName, "^#") and vanillaName) or EID.descriptions[EID.DefaultLanguageCode][tableName][pillID][2] or vanillaName name = string.gsub(name,"I'm Excited!!!","I'm Excited!!") -- prevent markup trigger + return name end