Fixed error with some search queries with no results
This commit is contained in:
1 parent
de18cd3c4c
commit
3620f6250e
2 files changed
+6
-12
No files matched your search
+1
-10
@@ -491,6 +491,7 @@ function EID:getDescriptionEntry(objTable, objID, noFallback)
|
|||||||
else return (translatedTable and translatedTable[objID]) or (EID.descriptions["en_us"][objTable] and EID.descriptions["en_us"][objTable][objID]) end
|
else return (translatedTable and translatedTable[objID]) or (EID.descriptions["en_us"][objTable] and EID.descriptions["en_us"][objTable][objID]) end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function EID:getDescriptionEntryEnglish(objTable, objID)
|
function EID:getDescriptionEntryEnglish(objTable, objID)
|
||||||
if not objID then
|
if not objID then
|
||||||
return EID.descriptions["en_us"][objTable]
|
return EID.descriptions["en_us"][objTable]
|
||||||
@@ -511,16 +512,6 @@ function EID:getDescriptionData(Type, Variant, SubType)
|
|||||||
|
|
||||||
return moddedDesc or legacyModdedDescription or defaultDesc
|
return moddedDesc or legacyModdedDescription or defaultDesc
|
||||||
end
|
end
|
||||||
function EID:getDescriptionDataEnglish(Type, Variant, SubType)
|
|
||||||
local fullString = Type.."."..Variant
|
|
||||||
local adjustedID = EID:getAdjustedSubtype(Type, Variant, SubType)
|
|
||||||
local moddedDesc = EID:getDescriptionEntryEnglish("custom", fullString.."."..adjustedID)
|
|
||||||
local tableName = EID:getTableName(Type, Variant, SubType)
|
|
||||||
local legacyModdedDescription = EID:getLegacyModDescription(Type, Variant, adjustedID)
|
|
||||||
local defaultDesc = EID:getDescriptionEntryEnglish(tableName, adjustedID)
|
|
||||||
|
|
||||||
return moddedDesc or legacyModdedDescription or defaultDesc
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Returns an adjusted SubType id for special cases like Horse Pills and Golden Trinkets
|
-- Returns an adjusted SubType id for special cases like Horse Pills and Golden Trinkets
|
||||||
function EID:getAdjustedSubtype(Type, Variant, SubType)
|
function EID:getAdjustedSubtype(Type, Variant, SubType)
|
||||||
|
|||||||
@@ -1307,15 +1307,18 @@ function EID:handleBagOfCraftingRendering(ignoreRefreshRate)
|
|||||||
if EID:BoCSGetSearchEnabled() then
|
if EID:BoCSGetSearchEnabled() then
|
||||||
-- Filter out item names that don't match our search term
|
-- Filter out item names that don't match our search term
|
||||||
for _,id in ipairs(sortedIDs) do
|
for _,id in ipairs(sortedIDs) do
|
||||||
local searchValid = #currentRecipesList[id] > 0 and (not EID:BoCSGetSearchEnabled() or EID:BoCSCheckItemName(EID:getDescriptionData(5, 100, id)[2]))
|
local searchValid = #currentRecipesList[id] > 0 and EID:BoCSCheckItemName(EID:getObjectName(5, 100, id))
|
||||||
if (searchValid) then table.insert(IDsToCheck, id) end
|
if (searchValid) then table.insert(IDsToCheck, id) end
|
||||||
end
|
end
|
||||||
-- Nothing in our recipe list passed the test; try checking English names as a backup
|
-- Nothing in our recipe list passed the test; try checking English names as a backup
|
||||||
if #IDsToCheck == 0 then
|
if #IDsToCheck == 0 then
|
||||||
|
local curLang = EID:getLanguage()
|
||||||
|
EID.Config["Language"] = "en_us"
|
||||||
for _,id in ipairs(sortedIDs) do
|
for _,id in ipairs(sortedIDs) do
|
||||||
local searchValid = not EID:BoCSGetSearchEnabled() or EID:BoCSCheckItemName(EID:getDescriptionDataEnglish(5, 100, id)[2])
|
local searchValid = EID:BoCSCheckItemName(EID:getObjectName(5, 100, id))
|
||||||
if (searchValid) then table.insert(IDsToCheck, id) end
|
if (searchValid) then table.insert(IDsToCheck, id) end
|
||||||
end
|
end
|
||||||
|
EID.Config["Language"] = curLang
|
||||||
end
|
end
|
||||||
else IDsToCheck = sortedIDs end
|
else IDsToCheck = sortedIDs end
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user