Processing Audit Part 1 (#22803)

Oh look at that, every modular computer in existence was always
processing at all times, regardless of if it was actually needed.
There's a couple more small examples I caught in my first pass, but all
of the rest are very low incidence. There are of course a very large
number of modular computers at any one point in time.
This commit is contained in:
VMSolidus
2026-07-09 17:03:42 -04:00
committed by GitHub
parent 25d8b2e6ae
commit 30fb0f69a0
7 changed files with 22 additions and 29 deletions
@@ -3,7 +3,7 @@
if(!enabled) // The computer is turned off
last_power_usage = 0
return FALSE
return PROCESS_KILL // Unpowered computers don't need to process.
if(health <= broken_damage)
shutdown_computer()
@@ -85,7 +85,6 @@
/obj/item/modular_computer/Initialize()
. = ..()
START_PROCESSING(SSprocessing, src)
install_default_hardware()
if(hard_drive)
install_default_programs()
@@ -319,6 +318,7 @@
return GLOB.ntnet_global.add_log(text, network_card)
/obj/item/modular_computer/proc/shutdown_computer(var/loud = TRUE)
STOP_PROCESSING(SSprocessing, src)
SStgui.close_uis(active_program)
kill_program_shutdown(TRUE)
for(var/datum/computer_file/program/P in idle_threads)
@@ -340,6 +340,7 @@
update_icon()
/obj/item/modular_computer/proc/enable_computer(var/mob/user, var/ar_forced=FALSE)
START_PROCESSING(SSprocessing, src)
enabled = TRUE
if(looping_sound)
soundloop.start(src)