diff --git a/code/controllers/master_controller.dm b/code/controllers/master_controller.dm index 75ed7249d90..3c2db8e0642 100644 --- a/code/controllers/master_controller.dm +++ b/code/controllers/master_controller.dm @@ -298,7 +298,11 @@ datum/controller/game_controller/proc/process_machines_power() var/area/SubArea = A.related[j] for(var/obj/machinery/M in SubArea) if(M) - if(M.use_power) + //check if the area has power for M's channel + //this will keep stat updated in case the machine is moved from one area to another. + M.update_powered_status(A) //we've already made sure A is a master area, above. + + if(!(M.stat & NOPOWER) && M.use_power) M.auto_use_power() if(A.apc.len && A.master == A) diff --git a/code/modules/power/power.dm b/code/modules/power/power.dm index 61e09a000d4..67f9b2b4ad6 100644 --- a/code/modules/power/power.dm +++ b/code/modules/power/power.dm @@ -77,6 +77,14 @@ stat |= NOPOWER return +//This is used by the master controller to update the NOPOWER flag +//This will allow machines to update NOPOWER if they are moved from one area to another. +//Does the same thing as power_change() but is optimized for the master controller. +/obj/machinery/proc/update_powered_status(var/area/master_area) + if(master_area.powered(power_channel)) + stat &= ~NOPOWER + else + stat |= NOPOWER // the powernet datum // each contiguous network of cables & nodes