diff --git a/init.lua b/init.lua index 6994639..c6c23da 100644 --- a/init.lua +++ b/init.lua @@ -127,13 +127,13 @@ local collect_items = function(filter, lang_code) -- First, try to match original description if desc ~= "" then local ldesc = string.lower(desc) - matches = string.match(ldesc, filter) ~= nil + matches = string.find(ldesc, filter, 1, true) ~= nil -- Second, try to match translated description if not matches then local tdesc = minetest.get_translated_string(lang_code, desc) if tdesc ~= "" then tdesc = string.lower(tdesc) - matches = string.match(tdesc, filter) ~= nil + matches = string.find(tdesc, filter, 1, true) ~= nil end end -- Third, try to match translated short description @@ -142,14 +142,14 @@ local collect_items = function(filter, lang_code) if sdesc ~= "" then sdesc = minetest.get_translated_string(lang_code, sdesc) sdesc = string.lower(sdesc) - matches = string.match(sdesc, filter) ~= nil + matches = string.find(sdesc, filter, 1, true) ~= nil end end end -- Fourth, try to match itemstring if not matches then - matches = string.match(itemstring, filter) ~= nil + matches = string.find(itemstring, filter, 1, true) ~= nil end -- If item was matched, add to item list