From da5828d1fc0d7ac0700cc7fe666c3844411bc084 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Sun, 11 Sep 2022 17:01:31 +0200 Subject: [PATCH] [MIRROR] Silences gravgen admin alerts / logging when the round is not in progress [MDB IGNORE] (#16165) * Silences gravgen admin alerts / logging when the round is not in progress (#69802) Just silencing minor nuisance messages. admin: Silenced grav generator admin warnings / logging messages when the round is not currently in progress. * Silences gravgen admin alerts / logging when the round is not in progress Co-authored-by: ShizCalev --- code/modules/power/gravitygenerator.dm | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/code/modules/power/gravitygenerator.dm b/code/modules/power/gravitygenerator.dm index 8f34edab6e8..4c2dfc4f69f 100644 --- a/code/modules/power/gravitygenerator.dm +++ b/code/modules/power/gravitygenerator.dm @@ -283,7 +283,8 @@ GLOBAL_LIST_EMPTY(gravity_generators) /obj/machinery/gravity_generator/main/power_change() . = ..() - investigate_log("has [machine_stat & NOPOWER ? "lost" : "regained"] power.", INVESTIGATE_GRAVITY) + if(SSticker.current_state == GAME_STATE_PLAYING) + investigate_log("has [machine_stat & NOPOWER ? "lost" : "regained"] power.", INVESTIGATE_GRAVITY) set_power() /obj/machinery/gravity_generator/main/get_status() @@ -300,7 +301,8 @@ GLOBAL_LIST_EMPTY(gravity_generators) new_state = TRUE charging_state = new_state ? POWER_UP : POWER_DOWN // Startup sequence animation. - investigate_log("is now [charging_state == POWER_UP ? "charging" : "discharging"].", INVESTIGATE_GRAVITY) + if(SSticker.current_state == GAME_STATE_PLAYING) + investigate_log("is now [charging_state == POWER_UP ? "charging" : "discharging"].", INVESTIGATE_GRAVITY) update_appearance() /obj/machinery/gravity_generator/main/proc/enable() @@ -310,8 +312,9 @@ GLOBAL_LIST_EMPTY(gravity_generators) soundloop.start() if (!gravity_in_level()) - investigate_log("was brought online and is now producing gravity for this level.", INVESTIGATE_GRAVITY) - message_admins("The gravity generator was brought online [ADMIN_VERBOSEJMP(src)]") + if(SSticker.current_state == GAME_STATE_PLAYING) + investigate_log("was brought online and is now producing gravity for this level.", INVESTIGATE_GRAVITY) + message_admins("The gravity generator was brought online [ADMIN_VERBOSEJMP(src)]") shake_everyone() gravity_field = new(src, 2, TRUE, 6) @@ -325,8 +328,9 @@ GLOBAL_LIST_EMPTY(gravity_generators) soundloop.stop() QDEL_NULL(gravity_field) if (gravity_in_level()) - investigate_log("was brought offline and there is now no gravity for this level.", INVESTIGATE_GRAVITY) - message_admins("The gravity generator was brought offline with no backup generator. [ADMIN_VERBOSEJMP(src)]") + if(SSticker.current_state == GAME_STATE_PLAYING) + investigate_log("was brought offline and there is now no gravity for this level.", INVESTIGATE_GRAVITY) + message_admins("The gravity generator was brought offline with no backup generator. [ADMIN_VERBOSEJMP(src)]") shake_everyone() complete_state_update()