Skip to content

Commit

Permalink
[MIRROR] Adds investigative logging for vent overclocking [MDB IGNORE] (
Browse files Browse the repository at this point in the history
#846)

* Adds investigative logging for vent overclocking (#79932)

---------

Co-authored-by: SkyratBot <[email protected]>
Co-authored-by: Jacquerel <[email protected]>
  • Loading branch information
3 people authored Nov 27, 2023
1 parent 085e65f commit 007d122
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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()
Expand All @@ -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()
Expand Down

0 comments on commit 007d122

Please sign in to comment.