mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-13 00:47:31 +01:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user