diff --git a/code/WorkInProgress/Aryn/Lighting/Engine.dm b/code/WorkInProgress/Aryn/Lighting/Engine.dm index 3e9254acc2..061918b414 100644 --- a/code/WorkInProgress/Aryn/Lighting/Engine.dm +++ b/code/WorkInProgress/Aryn/Lighting/Engine.dm @@ -171,9 +171,10 @@ turf/proc/ResetAllLights() /turf/space/ResetAllLights() var/atom/movable/lighting_overlay/overlay = locate() in src - overlay.loc = null - light_overlay = null - is_outside = 1 + if (overlay) + overlay.loc = null + light_overlay = null + is_outside = 1 . = ..() turf/proc/ResetValue() diff --git a/code/WorkInProgress/Aryn/Lighting/Light.dm b/code/WorkInProgress/Aryn/Lighting/Light.dm index 28eb733a27..4c9a04884e 100644 --- a/code/WorkInProgress/Aryn/Lighting/Light.dm +++ b/code/WorkInProgress/Aryn/Lighting/Light.dm @@ -48,6 +48,8 @@ light/proc/Off() lit_turfs = list() light/proc/CalculateBrightness(turf/T) + if (!atom) + retun 0 var/square = get_square_dist(atom.x,atom.y,atom.z,T.x,T.y,T.z) if(square > (radius+2)*(radius+2)) return 0 //+2 offset gives an ambient light effect.