summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZefram <zefram@fysh.org>2014-06-13 08:34:29 +0100
committerDiego Martinez <kaeza@users.sf.net>2014-06-13 04:50:07 -0300
commit7f4f0fd225f78ddde0c9c65bb1e2aa074c00949b (patch)
treef3af9de296cd13da8347872e43c71045b91127dd
parent833a255ad46420807d5baf72c52933471fd24cf1 (diff)
Use plain substring search in craft guide
The user input was being erroneously treated as a lua regexp.
-rw-r--r--internal.lua6
1 files changed, 1 insertions, 5 deletions
diff --git a/internal.lua b/internal.lua
index 335af7a..7724c9d 100644
--- a/internal.lua
+++ b/internal.lua
@@ -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]={}