Mass-replacement of stat to machine_stat (#48758)

Living and machine stat vars are pretty different, one uses flags and other number-defines.
This should make some other mass-replacements and searches a bit easier.
This commit is contained in:
Rohesie
2020-01-23 20:37:17 -03:00
committed by oranges
parent b961d49f5b
commit 7bef84f009
131 changed files with 422 additions and 416 deletions
@@ -55,7 +55,7 @@
icon_state = icon_state_powered
if(!cpu || !cpu.enabled)
if (!(stat & NOPOWER) && (cpu && cpu.use_power()))
if (!(machine_stat & NOPOWER) && (cpu && cpu.use_power()))
add_overlay(screen_icon_screensaver)
else
icon_state = icon_state_unpowered
@@ -121,13 +121,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)
stat |= NOPOWER
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.
stat &= ~NOPOWER
machine_stat &= ~NOPOWER
update_icon()
return
. = ..()