diff --git a/code/controllers/configuration/entries/config.dm b/code/controllers/configuration/entries/config.dm index aaa3b2a029f..2c7e5c97cfe 100644 --- a/code/controllers/configuration/entries/config.dm +++ b/code/controllers/configuration/entries/config.dm @@ -371,4 +371,11 @@ CONFIG_TWEAK(number/mc_tick_rate) CONFIG_TWEAK(number/mc_tick_rate/ValidateAndSet(str_val)) . = ..() if (.) - Master.UpdateTickRate() \ No newline at end of file + Master.UpdateTickRate() + +CONFIG_DEF(flag/resume_after_initializations) + +CONFIG_TWEAK(flag/ValidateAndSet(str_val)) + . = ..() + if(. && Master.current_runlevel) + world.sleep_offline = !value diff --git a/code/controllers/master.dm b/code/controllers/master.dm index 852437705bd..568257e10f0 100644 --- a/code/controllers/master.dm +++ b/code/controllers/master.dm @@ -189,10 +189,12 @@ GLOBAL_REAL(Master, /datum/controller/master) = new // Sort subsystems by display setting for easy access. sortTim(subsystems, /proc/cmp_subsystem_display) // Set world options. - world.sleep_offline = 1 + world.sleep_offline = TRUE world.fps = CONFIG_GET(number/fps) var/initialized_tod = REALTIMEOFDAY sleep(1) + if(CONFIG_GET(flag/resume_after_initializations)) + world.sleep_offline = FALSE initializations_finished_with_no_players_logged_in = initialized_tod < REALTIMEOFDAY - 10 // Loop. Master.StartProcessing(0) diff --git a/config/config.txt b/config/config.txt index dde1c5f1c66..ba10f04c398 100644 --- a/config/config.txt +++ b/config/config.txt @@ -388,3 +388,6 @@ HIGH_POP_MC_MODE_AMOUNT 65 ##Disengage high pop mode if player count drops below this DISABLE_HIGH_POP_MC_MODE_AMOUNT 60 + +## Uncomment to prevent the world from sleeping while no players are connected after initializations +#RESUME_AFTER_INITIALIZATIONS