mirror of
https://github.com/minetest-mods/unified_inventory.git
synced 2024-12-30 20:50:23 +01:00
Use plain substring search in craft guide
The user input was being erroneously treated as a lua regexp.
This commit is contained in:
parent
833a255ad4
commit
7f4f0fd225
@ -97,10 +97,6 @@ end
|
||||
function unified_inventory.apply_filter(player, filter)
|
||||
local player_name = player:get_player_name()
|
||||
local lfilter = string.lower(filter)
|
||||
if not pcall(function() ("technic:test"):find(lfilter) end) then
|
||||
-- Filter is invalid
|
||||
lfilter = ""
|
||||
end
|
||||
local ffilter
|
||||
if lfilter:sub(1, 6) == "group:" then
|
||||
local groups = lfilter:sub(7):split(",")
|
||||
@ -116,7 +112,7 @@ function unified_inventory.apply_filter(player, filter)
|
||||
ffilter = function(name, def)
|
||||
local lname = string.lower(name)
|
||||
local ldesc = string.lower(def.description)
|
||||
return string.find(lname, lfilter) or string.find(ldesc, lfilter)
|
||||
return string.find(lname, lfilter, 1, true) or string.find(ldesc, lfilter, 1, true)
|
||||
end
|
||||
end
|
||||
unified_inventory.filtered_items_list[player_name]={}
|
||||
|
Loading…
Reference in New Issue
Block a user