Cache results only if searched 2 times (to avoid silly searches)

This commit is contained in:
JP Guerrero 2018-04-27 22:55:30 +02:00
parent c630c90970
commit d95cdee33d

@ -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