1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-01-04 00:15:45 +02:00

Disable start_now in collapse rather than adding disable feature.

It looks like this works to keep the collapse logic from running.
It relies on the dungeons on_init function running after the collapse
one.
This commit is contained in:
Eric Anderson 2022-04-24 19:50:50 -07:00
parent 7cc268fab6
commit 7e55d2453e
2 changed files with 5 additions and 9 deletions

View File

@ -19,7 +19,6 @@ local Autostash = require 'modules.autostash'
local Panel = require 'utils.gui.config'
Panel.get('gui_config').spaghett.noop = true
local Collapse = require 'modules.collapse'
Collapse.disable()
local Changelog = require 'modules.changelog'
require 'maps.dungeons.boss_arena'
require 'modules.melee_mode'
@ -749,6 +748,9 @@ end
-- end
local function on_init()
-- dungeons depends on rpg.main depends on modules.explosives depends on modules.collapse
-- without disabling collapse, it starts logging lots of errors after ~1 week.
Collapse.start_now(false)
local dungeontable = DungeonsTable.get_dungeontable()
local forceshp = BiterHealthBooster.get('biter_health_boost_forces')
local force = game.create_force('dungeon')

View File

@ -5,10 +5,8 @@ local math_floor = math.floor
local table_shuffle_table = table.shuffle_table
local collapse = {
debug = false,
disabled = false,
debug = false
}
Global.register(
collapse,
function(tbl)
@ -272,16 +270,12 @@ local function on_init()
end
local function on_tick()
if game.tick % collapse.speed ~= 0 or collapse.disabled then
if game.tick % collapse.speed ~= 0 then
return
end
progress()
end
function Public.disable()
collapse.disabled = true
end
local Event = require 'utils.event'
Event.on_init(on_init)
Event.add(defines.events.on_tick, on_tick)