From 5aea034d881280eeef65d4268d5e856271fb1e04 Mon Sep 17 00:00:00 2001 From: kevinz000 <2003111+kevinz000@users.noreply.github.com> Date: Sun, 10 May 2020 15:12:13 -0700 Subject: [PATCH] k --- code/__HELPERS/unsorted.dm | 2 +- code/game/world.dm | 9 ++++++--- tgstation.dme | 1 + 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index 830e933518..e6663be5b9 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -1573,7 +1573,7 @@ GLOBAL_DATUM_INIT(dview_mob, /mob/dview, new) /proc/send2chat(message, config_setting) if(config_setting == null) return - + UNTIL(GLOB.tgs_initialized) if(!world.TgsAvailable()) return diff --git a/code/game/world.dm b/code/game/world.dm index 45ed035e58..bd56ffdbf4 100644 --- a/code/game/world.dm +++ b/code/game/world.dm @@ -1,6 +1,7 @@ #define RESTART_COUNTER_PATH "data/round_counter.txt" GLOBAL_VAR(restart_counter) +GLOBAL_VAR_INIT(tgs_initialized, FALSE) GLOBAL_VAR(topic_status_lastcache) GLOBAL_LIST(topic_status_cache) @@ -38,9 +39,6 @@ GLOBAL_LIST(topic_status_cache) #ifndef USE_CUSTOM_ERROR_HANDLER world.log = file("[GLOB.log_directory]/dd.log") -#else - if (TgsAvailable()) - world.log = file("[GLOB.log_directory]/dd.log") //not all runtimes trigger world/Error, so this is the only way to ensure we can see all of them. #endif load_admins() @@ -69,6 +67,11 @@ GLOBAL_LIST(topic_status_cache) /world/proc/InitTgs() TgsNew(new /datum/tgs_event_handler/impl, TGS_SECURITY_TRUSTED) GLOB.revdata.load_tgs_info() +#ifdef USE_CUSTOM_ERROR_HANDLER + if (TgsAvailable()) + world.log = file("[GLOB.log_directory]/dd.log") //not all runtimes trigger world/Error, so this is the only way to ensure we can see all of them. +#endif + GLOB.tgs_initialized = TRUE /world/proc/HandleTestRun() //trigger things to run the whole process diff --git a/tgstation.dme b/tgstation.dme index d61a1c4ef9..34cf0e354a 100755 --- a/tgstation.dme +++ b/tgstation.dme @@ -366,6 +366,7 @@ #include "code\datums\shuttles.dm" #include "code\datums\soullink.dm" #include "code\datums\spawners_menu.dm" +#include "code\datums\tgs_event_handler.dm" #include "code\datums\verbs.dm" #include "code\datums\weakrefs.dm" #include "code\datums\world_topic.dm"