From 11acb0c6347c872a9237b06c55d495075db3b58e Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Sun, 10 Jan 2021 08:21:34 +0100 Subject: [PATCH] [MIRROR] Fix startup double runtimes again (#2607) * Fix startup double runtimes again (#56047) Prevents runtimes that occur before /world/New is called from runtiming in /world/Error due to lack of the config being loaded. * Fix startup double runtimes again Co-authored-by: Jordan Brown --- code/controllers/configuration/configuration.dm | 5 +++++ code/modules/error_handler/error_viewer.dm | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/code/controllers/configuration/configuration.dm b/code/controllers/configuration/configuration.dm index e59548399a1..55930cfa600 100644 --- a/code/controllers/configuration/configuration.dm +++ b/code/controllers/configuration/configuration.dm @@ -21,6 +21,9 @@ var/motd var/policy + /// If the configuration is loaded + var/loaded = FALSE + var/static/regex/ic_filter_regex /datum/controller/configuration/proc/admin_reload() @@ -53,6 +56,8 @@ LoadPolicy() LoadChatFilter() + loaded = TRUE + if (Master) Master.OnConfigLoad() diff --git a/code/modules/error_handler/error_viewer.dm b/code/modules/error_handler/error_viewer.dm index adcbb8fb57f..dd0089245ae 100644 --- a/code/modules/error_handler/error_viewer.dm +++ b/code/modules/error_handler/error_viewer.dm @@ -118,7 +118,7 @@ GLOBAL_DATUM(error_cache, /datum/error_viewer/error_cache) var/const/viewtext = "\[view]" // Nesting these in other brackets went poorly //log_debug("Runtime in [e.file], line [e.line]: [html_encode(e.name)] [error_entry.make_link(viewtext)]") var/err_msg_delay - if(config) + if(config?.loaded) err_msg_delay = CONFIG_GET(number/error_msg_delay) else var/datum/config_entry/CE = /datum/config_entry/number/error_msg_delay