From c460124da25dab86349e84a883e28467e98ea22e Mon Sep 17 00:00:00 2001 From: TullyBurnalot Date: Mon, 9 Jan 2017 03:25:34 +0000 Subject: [PATCH] Broken-but-On Light fix --- code/modules/power/apc.dm | 2 ++ code/modules/power/lighting.dm | 3 +++ 2 files changed, 5 insertions(+) diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index ae931484524..d359744320c 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -1367,6 +1367,8 @@ cell.use(20) spawn(0) for(var/obj/machinery/light/L in area) + if(!L.isfunctional()) + continue if(prob(chance)) L.on = 1 L.broken() diff --git a/code/modules/power/lighting.dm b/code/modules/power/lighting.dm index 18a760f5f1d..1c2a0397b62 100644 --- a/code/modules/power/lighting.dm +++ b/code/modules/power/lighting.dm @@ -581,6 +581,9 @@ sleep(1) qdel(src) +/obj/machinery/light/proc/isfunctional() + return status == LIGHT_OK + // the light item // can be tube or bulb subtypes // will fit into empty /obj/machinery/light of the corresponding type