mirror of
https://github.com/ComfyFactory/ComfyFactorio.git
synced 2025-01-10 00:43:27 +02:00
19 lines
542 B
Lua
19 lines
542 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) |