mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 02:34:00 +00:00
Fixes #10210
This commit is contained in:
@@ -189,9 +189,7 @@
|
|||||||
..()
|
..()
|
||||||
|
|
||||||
spawn(2)
|
spawn(2)
|
||||||
var/area/A = get_area(src)
|
on = has_power()
|
||||||
if(A && !A.requires_power)
|
|
||||||
on = 1
|
|
||||||
|
|
||||||
switch(fitting)
|
switch(fitting)
|
||||||
if("tube")
|
if("tube")
|
||||||
@@ -398,7 +396,7 @@
|
|||||||
// true if area has power and lightswitch is on
|
// true if area has power and lightswitch is on
|
||||||
/obj/machinery/light/proc/has_power()
|
/obj/machinery/light/proc/has_power()
|
||||||
var/area/A = src.loc.loc
|
var/area/A = src.loc.loc
|
||||||
return A.lightswitch && A.power_light
|
return A.lightswitch && (!A.requires_power || A.power_light)
|
||||||
|
|
||||||
/obj/machinery/light/proc/flicker(var/amount = rand(10, 20))
|
/obj/machinery/light/proc/flicker(var/amount = rand(10, 20))
|
||||||
if(flickering) return
|
if(flickering) return
|
||||||
@@ -570,8 +568,7 @@
|
|||||||
// called when area power state changes
|
// called when area power state changes
|
||||||
/obj/machinery/light/power_change()
|
/obj/machinery/light/power_change()
|
||||||
spawn(10)
|
spawn(10)
|
||||||
var/area/A = src.loc.loc
|
seton(has_power())
|
||||||
seton(A.lightswitch && A.power_light)
|
|
||||||
|
|
||||||
// called when on fire
|
// called when on fire
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user