From 08a0ba569222bfff6c27aafee88cc443794e36de Mon Sep 17 00:00:00 2001 From: CitadelStationBot Date: Sat, 17 Jun 2017 15:17:21 -0500 Subject: [PATCH] Fix some things assuming lighting corners existed (#1642) --- code/modules/lighting/lighting_source.dm | 10 ++++++++++ code/modules/lighting/lighting_turf.dm | 6 ++++++ 2 files changed, 16 insertions(+) diff --git a/code/modules/lighting/lighting_source.dm b/code/modules/lighting/lighting_source.dm index 63457a1ce9..dd5cd53690 100644 --- a/code/modules/lighting/lighting_source.dm +++ b/code/modules/lighting/lighting_source.dm @@ -270,6 +270,8 @@ source_turf.luminosity = Ceiling(light_range) for(T in view(Ceiling(light_range), source_turf)) for (thing in T.get_corners(source_turf)) + if(!thing) + continue C = thing corners[C] = 0 turfs += T @@ -291,6 +293,8 @@ LAZYINITLIST(effect_str) if (needs_update == LIGHTING_VIS_UPDATE) for (thing in corners - effect_str) // New corners + if(!thing) + continue C = thing LAZYADD(C.affecting, src) if (!C.active) @@ -300,6 +304,8 @@ else L = corners - effect_str for (thing in L) // New corners + if(!thing) + continue C = thing LAZYADD(C.affecting, src) if (!C.active) @@ -308,6 +314,8 @@ APPLY_CORNER(C) for (thing in corners - L) // Existing corners + if(!thing) + continue C = thing if (!C.active) effect_str[C] = 0 @@ -316,6 +324,8 @@ L = effect_str - corners for (thing in L) // Old, now gone, corners. + if(!thing) + continue C = thing REMOVE_CORNER(C) LAZYREMOVE(C.affecting, src) diff --git a/code/modules/lighting/lighting_turf.dm b/code/modules/lighting/lighting_turf.dm index ca6866c48e..49e89685ee 100644 --- a/code/modules/lighting/lighting_turf.dm +++ b/code/modules/lighting/lighting_turf.dm @@ -24,6 +24,8 @@ var/datum/lighting_corner/C var/thing for (thing in corners) + if(!thing) + continue C = thing C.update_active() @@ -45,6 +47,8 @@ var/datum/lighting_corner/C var/datum/light_source/S for (thing in corners) + if(!thing) + continue C = thing if (!C.active) // We would activate the corner, calculate the lighting for it. for (thing in C.affecting) @@ -61,6 +65,8 @@ var/thing var/datum/lighting_corner/L for (thing in corners) + if(!thing) + continue L = thing totallums += L.lum_r + L.lum_b + L.lum_g