Fix crash when searching for "["
This commit is contained in:
parent
b03c1451ca
commit
277773b32a
6
init.lua
6
init.lua
@ -127,7 +127,7 @@ local collect_items = function(filter, lang_code)
|
|||||||
-- First, try to match original description
|
-- First, try to match original description
|
||||||
if desc ~= "" then
|
if desc ~= "" then
|
||||||
local ldesc = string.lower(desc)
|
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
|
-- Second, try to match translated description
|
||||||
if not matches then
|
if not matches then
|
||||||
local tdesc = minetest.get_translated_string(lang_code, desc)
|
local tdesc = minetest.get_translated_string(lang_code, desc)
|
||||||
@ -142,14 +142,14 @@ local collect_items = function(filter, lang_code)
|
|||||||
if sdesc ~= "" then
|
if sdesc ~= "" then
|
||||||
sdesc = minetest.get_translated_string(lang_code, sdesc)
|
sdesc = minetest.get_translated_string(lang_code, sdesc)
|
||||||
sdesc = string.lower(sdesc)
|
sdesc = string.lower(sdesc)
|
||||||
matches = string.match(sdesc, filter) ~= nil
|
matches = string.find(sdesc, filter, 1, true) ~= nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
-- Fourth, try to match itemstring
|
-- Fourth, try to match itemstring
|
||||||
if not matches then
|
if not matches then
|
||||||
matches = string.match(itemstring, filter) ~= nil
|
matches = string.find(itemstring, filter, 1, true) ~= nil
|
||||||
end
|
end
|
||||||
|
|
||||||
-- If item was matched, add to item list
|
-- If item was matched, add to item list
|
||||||
|
Loading…
x
Reference in New Issue
Block a user