Fixes a runtime with lights during explosions

This commit is contained in:
Kelenius
2015-08-21 13:01:35 +03:00
parent f834263f84
commit c074f9ee9e

View File

@@ -390,8 +390,8 @@
// returns whether this light has power
// true if area has power and lightswitch is on
/obj/machinery/light/proc/has_power()
var/area/A = src.loc.loc
return A.lightswitch && (!A.requires_power || A.power_light)
var/area/A = get_area(src)
return A && A.lightswitch && (!A.requires_power || A.power_light)
/obj/machinery/light/proc/flicker(var/amount = rand(10, 20))
if(flickering) return