Merge pull request #4541 from comma/dev

Sanity plugs for two runtimes in lightning code
This commit is contained in:
Zuhayr
2014-03-08 00:38:12 +10:30
2 changed files with 6 additions and 3 deletions

View File

@@ -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()

View File

@@ -48,6 +48,8 @@ light/proc/Off()
lit_turfs = list()
light/proc/CalculateBrightness(turf/T)
if (!atom)
return 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.