fix: Pill names now get evaluated correctly, when ItemNames table entry is present
This commit is contained in:
1 parent
13ba58808f
commit
c0e7034e00
1 file changed
+8
-3
@@ -1016,19 +1016,24 @@ 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
|
||||
|
||||
local vanillaName = ""
|
||||
if pillID == 9999 then
|
||||
vanillaName = "Golden Pill" -- only used for languages that haven't defined a Golden Pill name
|
||||
else
|
||||
if EID.itemConfig:GetPillEffect(pillID - 1) == nil then
|
||||
return "<INVALID PILL ID>"
|
||||
else
|
||||
vanillaName = EID.itemConfig:GetPillEffect(pillID - 1).Name
|
||||
end
|
||||
name = name and name[2] or (not string.find(vanillaName, "^#") and vanillaName) or EID.descriptions[EID.DefaultLanguageCode][tableName][pillID][2] or vanillaName
|
||||
end
|
||||
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
|
||||
|
||||
|
||||
Reference in new issue
Block a user