From 2785d0f3da63dfeb93d48ac7db048b5922d45c71 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Mon, 27 Nov 2023 07:00:57 +0100 Subject: [PATCH] [MIRROR] Adds investigative logging for vent overclocking [MDB IGNORE] (#25271) * Adds investigative logging for vent overclocking (#79932) ## About The Pull Request Basically what it says in the title. We added a feature which could destroy vents but forgot to log who turned it on and forgot to turn it off. Now the Investigate log for atmos will record who toggled overclocking, whether they turned it on or off, and whenever a vent was destroyed as a result of overlock damage. Also this removes a little bit of code which never ran, as a result of that it checked the integrity of the vent _before_ damaging it and does not process after being damaged to destruction. No changelog because it's not player facing. * Adds investigative logging for vent overclocking --------- Co-authored-by: Jacquerel --- .../atmospherics/machinery/air_alarm/_air_alarm.dm | 2 +- .../machinery/components/unary_devices/vent_pump.dm | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/code/modules/atmospherics/machinery/air_alarm/_air_alarm.dm b/code/modules/atmospherics/machinery/air_alarm/_air_alarm.dm index 24d1e63e42a..a3c9f2e3e84 100644 --- a/code/modules/atmospherics/machinery/air_alarm/_air_alarm.dm +++ b/code/modules/atmospherics/machinery/air_alarm/_air_alarm.dm @@ -362,7 +362,7 @@ GLOBAL_LIST_EMPTY_TYPED(air_alarms, /obj/machinery/airalarm) if("overclock") if(isnull(vent)) return TRUE - vent.toggle_overclock() + vent.toggle_overclock(source = key_name(user)) vent.update_appearance(UPDATE_ICON) return TRUE diff --git a/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm b/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm index 25713e55e37..a8a8aac4ff3 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm @@ -222,7 +222,7 @@ else // pump_direction == SIPHONING icon_state = "vent_in" -/obj/machinery/atmospherics/components/unary/vent_pump/proc/toggle_overclock(from_break = FALSE) +/obj/machinery/atmospherics/components/unary/vent_pump/proc/toggle_overclock(source, from_break = FALSE) fan_overclocked = !fan_overclocked if(from_break) @@ -234,6 +234,8 @@ else sound_loop.stop() + investigate_log("had its overlock setting [fan_overclocked ? "enabled" : "disabled"] by [source]", INVESTIGATE_ATMOS) + update_appearance() /obj/machinery/atmospherics/components/unary/vent_pump/process_atmos() @@ -247,13 +249,10 @@ if(!istype(us)) return - var/current_integrity = get_integrity() if(fan_overclocked) take_damage(fan_damage_rate, sound_effect=FALSE) - if(current_integrity == 0) - on = FALSE - set_is_operational(FALSE) - toggle_overclock(from_break = TRUE) + if(get_integrity() == 0) + investigate_log("was destroyed as a result of overclocking", INVESTIGATE_ATMOS) return var/percent_integrity = get_integrity_percentage()