Prevent EID:getObjectName() returning Empty name from default lang (#941)
* don't return blank name for english entries * some comments
This commit is contained in:
1 file changed
+2
-1
@@ -918,7 +918,8 @@ function EID:getObjectName(Type, Variant, SubType)
|
||||
local translatedName = EID.ItemNames[EID:getLanguage()][fallbackName]
|
||||
local itemNameTableEntry = translatedName ~= "" and translatedName or EID.ItemNames[EID.DefaultLanguageCode][fallbackName]
|
||||
-- return itemName table entry if found and not pills/horsepills
|
||||
if itemNameTableEntry and tableName ~= "pills" and tableName ~= "horsepills" then return itemNameTableEntry end
|
||||
-- 'EID.ItemNames[EID.DefaultLanguageCode][fallbackName]' can also be empty check if it is empty again, to check ItemConfig stuff propery
|
||||
if itemNameTableEntry and itemNameTableEntry ~= "" and tableName ~= "pills" and tableName ~= "horsepills" then return itemNameTableEntry end
|
||||
|
||||
local tableEntry = EID:getDescriptionData(Type, Variant, SubType)
|
||||
local name = nil
|
||||
|
||||
Reference in new issue
Block a user