Cleanup Progressive mode

This commit is contained in:
Jean-Patrick Guerrero 2021-11-24 01:50:43 +01:00
parent 0cedd16efe
commit 02e66f368a

View File

@ -23,16 +23,11 @@ local function get_filtered_items(player, data)
if recipes > 0 or usages > 0 then if recipes > 0 or usages > 0 then
c = c + 1 c = c + 1
items[c] = item items[c] = item
if data then
known = known + recipes + usages known = known + recipes + usages
end end
end end
end
if data then
data.known_recipes = known data.known_recipes = known
end
return items return items
end end
@ -207,8 +202,8 @@ local function poll_new_items()
local player = players[i] local player = players[i]
local name = player:get_player_name() local name = player:get_player_name()
local data = i3.data[name] local data = i3.data[name]
if not data then return end
if data then
local inv_items = get_inv_items(player) local inv_items = get_inv_items(player)
local diff = array_diff(inv_items, data.inv_items) local diff = array_diff(inv_items, data.inv_items)
@ -229,6 +224,7 @@ local function poll_new_items()
set_fs(player) set_fs(player)
end end
end end
end
core.after(POLL_FREQ, poll_new_items) core.after(POLL_FREQ, poll_new_items)
end end