mirror of
https://github.com/minetest-mods/craftguide.git
synced 2024-11-26 04:23:44 +01:00
Cache results only if searched 2 times (to avoid silly searches)
This commit is contained in:
parent
c630c90970
commit
d95cdee33d
7
init.lua
7
init.lua
@ -343,9 +343,14 @@ function craftguide:get_filter_items(data, player)
|
||||
if not data.items then
|
||||
data.init_filter_items = filtered_list
|
||||
end
|
||||
elseif filter ~= "" and not datas.searches[filter] then
|
||||
elseif filter ~= "" then
|
||||
-- Cache the results only if searched 2 times
|
||||
if datas.searches[filter] == nil then
|
||||
datas.searches[filter] = false
|
||||
else
|
||||
datas.searches[filter] = filtered_list
|
||||
end
|
||||
end
|
||||
|
||||
data.items = filtered_list
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user