diff --git a/code/WorkInProgress/Aryn/Lighting/Engine.dm b/code/WorkInProgress/Aryn/Lighting/Engine.dm index 061918b4145..250fe0c8862 100644 --- a/code/WorkInProgress/Aryn/Lighting/Engine.dm +++ b/code/WorkInProgress/Aryn/Lighting/Engine.dm @@ -91,6 +91,11 @@ atom/movable/New() opacity = 0 SetOpacity(1) +atom/movable/Del() + if(light) light.Off() + if(opacity) SetOpacity(0) + . = ..() + atom/movable/Move() var/o = opacity if(o) SetOpacity(0) @@ -171,10 +176,9 @@ turf/proc/ResetAllLights() /turf/space/ResetAllLights() var/atom/movable/lighting_overlay/overlay = locate() in src - if (overlay) - 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 e354154180d..6d1d612f7ec 100644 --- a/code/WorkInProgress/Aryn/Lighting/Light.dm +++ b/code/WorkInProgress/Aryn/Lighting/Light.dm @@ -28,6 +28,7 @@ light/var/list/lit_turfs light/var/atom/atom light/New(atom/atom) + ASSERT(atom) src.atom = atom light/proc/Reset() @@ -48,8 +49,7 @@ light/proc/Off() lit_turfs = list() light/proc/CalculateBrightness(turf/T) - if (!atom) - return 0 + ASSERT(T) 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.