diff --git a/code/game/machinery/cell_charger.dm b/code/game/machinery/cell_charger.dm
index 0d64e1718e8..1d6b8da9934 100644
--- a/code/game/machinery/cell_charger.dm
+++ b/code/game/machinery/cell_charger.dm
@@ -74,7 +74,7 @@
var/area/a = loc.loc // Gets our locations location, like a dream within a dream
if(!isarea(a))
return
- if(!a.powernet.equipment_powered) // There's no APC in this area, don't try to cheat power!
+ if(!a.powernet.has_power(PW_CHANNEL_EQUIPMENT)) // There's no APC in this area, don't try to cheat power!
to_chat(user, "[src] blinks red as you try to insert the cell!")
return
if(!user.drop_item())
diff --git a/code/game/machinery/recharger.dm b/code/game/machinery/recharger.dm
index 0d899321dec..c58062ade49 100644
--- a/code/game/machinery/recharger.dm
+++ b/code/game/machinery/recharger.dm
@@ -49,7 +49,7 @@
//Checks to make sure he's not in space doing it, and that the area got proper power.
var/area/A = get_area(src)
- if(!istype(A) || !A.powernet.equipment_powered)
+ if(!istype(A) || !A.powernet.has_power(PW_CHANNEL_EQUIPMENT))
to_chat(user, "[src] blinks red as you try to insert [G].")
return
diff --git a/code/modules/power/apc/apc.dm b/code/modules/power/apc/apc.dm
index c61b5e28a1b..8aecb4e0a8f 100644
--- a/code/modules/power/apc/apc.dm
+++ b/code/modules/power/apc/apc.dm
@@ -166,8 +166,15 @@
/obj/machinery/power/apc/Initialize(mapload)
. = ..()
+
+ var/area/A = get_area(src)
+
+ if(A.powernet && !A.powernet.powernet_apc)
+ A.powernet.powernet_apc = src
+
if(!mapload)
return
+
electronics_state = APC_ELECTRONICS_SECURED
// is starting with a power cell installed, create it and set its charge level
if(cell_type)
@@ -175,9 +182,6 @@
cell.maxcharge = cell_type // cell_type is maximum charge (old default was 1000 or 2500 (values one and two respectively)
cell.charge = start_charge * cell.maxcharge / 100 // (convert percentage to actual value)
- var/area/A = get_area(src)
-
-
//if area isn't specified use current
if(keep_preset_name)
if(isarea(A))
diff --git a/code/modules/power/lights.dm b/code/modules/power/lights.dm
index 9a2df3bddbf..08a5ed23f06 100644
--- a/code/modules/power/lights.dm
+++ b/code/modules/power/lights.dm
@@ -618,13 +618,13 @@
// if a light is turned off, it won't activate emergency power
/obj/machinery/light/proc/turned_off()
var/area/machine_area = get_area(src)
- return !machine_area.lightswitch && machine_area.powernet.lighting_powered
+ return !machine_area.lightswitch && machine_area.powernet.has_power(PW_CHANNEL_LIGHTING)
// returns whether this light has power
// true if area has power and lightswitch is on
/obj/machinery/light/has_power()
var/area/machine_area = get_area(src)
- return machine_area.lightswitch && machine_area.powernet.lighting_powered
+ return machine_area.lightswitch && machine_area.powernet.has_power(PW_CHANNEL_LIGHTING)
// attempts to set emergency lights
/obj/machinery/light/proc/set_emergency_lights()
@@ -809,7 +809,7 @@
/obj/machinery/light/power_change()
var/area/A = get_area(src)
if(A)
- seton(A.lightswitch && A.powernet.lighting_powered)
+ seton(A.lightswitch && A.powernet.has_power(PW_CHANNEL_LIGHTING))
// called when on fire
diff --git a/code/modules/power/powernets/local_powernet.dm b/code/modules/power/powernets/local_powernet.dm
index 1e9ce8f34b9..cd389f5a4a6 100644
--- a/code/modules/power/powernets/local_powernet.dm
+++ b/code/modules/power/powernets/local_powernet.dm
@@ -105,7 +105,9 @@
return FALSE
if(power_flags & PW_ALWAYS_POWERED) //if this powernet is always powered, we always return TRUE
return TRUE
- if(powernet_apc?.stat & (BROKEN|MAINT)) //no working apc, no power
+ if(!powernet_apc)
+ return FALSE
+ if(powernet_apc.stat & (BROKEN|MAINT)) // no working apc, no power
return FALSE
switch(channel)