Refactors machine_stat and is_processing() to process on demand (#53150)

This commit is contained in:
Rohesie
2020-08-24 17:38:30 -07:00
committed by GitHub
parent 2b0a322a37
commit 3a33f3ae47
61 changed files with 270 additions and 163 deletions
@@ -100,13 +100,13 @@
visible_message("<span class='danger'>\The [src]'s screen flickers [battery_module ? "\"BATTERY [malfunction ? "MALFUNCTION" : "CRITICAL"]\"" : "\"EXTERNAL POWER LOSS\""] warning as it shuts down unexpectedly.</span>")
if(cpu)
cpu.shutdown_computer(0)
machine_stat |= NOPOWER
set_machine_stat(machine_stat | NOPOWER)
update_icon()
// Modular computers can have battery in them, we handle power in previous proc, so prevent this from messing it up for us.
/obj/machinery/modular_computer/power_change()
if(cpu && cpu.use_power()) // If MC_CPU still has a power source, PC wouldn't go offline.
machine_stat &= ~NOPOWER
set_machine_stat(machine_stat & ~NOPOWER)
update_icon()
return
. = ..()
@@ -25,7 +25,7 @@
dos_speed = NTNETSPEED_ETHERNET * 10
if(target && executed)
target.dos_overload += dos_speed
if(!target.is_operational())
if(!target.is_operational)
target.dos_sources.Remove(src)
target = null
error = "Connection to destination relay lost."