From 12549b7e933411bb484e0fa51dfb7c8eb63362bc Mon Sep 17 00:00:00 2001 From: mwerezak Date: Sun, 9 Aug 2015 09:48:55 -0400 Subject: [PATCH] Fixes area power initialization Power channels start on when objects initialize, then are turned off and area machines notified in area initialization if an apc is not found. --- code/controllers/master_controller.dm | 11 ++++++++--- code/game/area/areas.dm | 11 +++++------ 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/code/controllers/master_controller.dm b/code/controllers/master_controller.dm index 25cccde771..47f3b8a649 100644 --- a/code/controllers/master_controller.dm +++ b/code/controllers/master_controller.dm @@ -88,17 +88,22 @@ datum/controller/game_controller/proc/setup() datum/controller/game_controller/proc/setup_objects() - world << "\red \b Initializing objects" + world << "Initializing areas" + sleep(-1) + for(var/area/area in all_areas) + area.initialize() - world << "\red \b Initializing pipe networks" + world << "Initializing atmos machinery." sleep(-1) for(var/obj/machinery/atmospherics/unary/U in machines) if(istype(U, /obj/machinery/atmospherics/unary/vent_pump)) diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm index 70e32096b7..f00281f8c0 100644 --- a/code/game/area/areas.dm +++ b/code/game/area/areas.dm @@ -21,14 +21,13 @@ luminosity = 1 lighting_use_dynamic = 0 - //If an APC is present it will set these, otherwise they stay off. - power_light = 0 - power_equip = 0 - power_environ = 0 - ..() -// spawn(15) +/area/proc/initialize() + if(!requires_power || !(locate(/obj/machinery/power/apc) in apc)) + power_light = 0 + power_equip = 0 + power_environ = 0 power_change() // all machines set to current power level, also updates lighting icon InitializeLighting()