1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-11-29 22:47:52 +02:00
This commit is contained in:
Gerkiz
2020-09-12 19:16:38 +02:00
parent e56515627d
commit f4c5ea7703
9 changed files with 83 additions and 280 deletions

View File

@@ -115,6 +115,27 @@ function Gui.clear(element)
element.clear()
end
local function clear_invalid_data()
for _, player in pairs(game.connected_players) do
local player_index = player.index
local values = data[player_index]
if values then
for _, element in next, values do
if type(element) == 'table' then
for key, obj in next, element do
if type(obj) == 'table' and obj.valid ~= nil then
if not obj.valid then
element[key] = nil
end
end
end
end
end
end
end
end
Event.on_nth_tick(300, clear_invalid_data)
local function handler_factory(event_id)
local handlers