1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-01-10 00:43:27 +02:00
ComfyFactorio/modules/scrap_towny_ffa/on_tick_schedule.lua
2021-03-24 16:46:00 +01:00

22 lines
578 B
Lua

local Table = require 'modules.scrap_towny_ffa.table'
local function on_tick()
local ffatable = Table.get_table()
if not ffatable.on_tick_schedule[game.tick] then
return
end
for _, schedule in pairs(ffatable.on_tick_schedule[game.tick]) do
schedule.func(unpack(schedule.args))
end
ffatable.on_tick_schedule[game.tick] = nil
end
local on_init = function()
local ffatable = Table.get_table()
ffatable.on_tick_schedule = {}
end
local Event = require 'utils.event'
Event.on_init(on_init)
Event.add(defines.events.on_tick, on_tick)