diff --git a/code/controllers/subsystem/lighting.dm b/code/controllers/subsystem/lighting.dm index 2eac9a1021..f813b3169b 100644 --- a/code/controllers/subsystem/lighting.dm +++ b/code/controllers/subsystem/lighting.dm @@ -1,4 +1,5 @@ - +// Needed for changeTurf() so it doesn't screw up before lighting overlays have been made. +var/lighting_overlays_initialized = FALSE var/datum/subsystem/lighting/SSlighting /var/list/lighting_update_lights = list() // List of lighting sources queued for update. @@ -29,6 +30,7 @@ var/datum/subsystem/lighting/SSlighting A.luminosity = 0 create_all_lighting_overlays() + global.lighting_overlays_initialized = TRUE /datum/subsystem/lighting/fire() diff --git a/code/modules/lighting/lighting_turf.dm b/code/modules/lighting/lighting_turf.dm index 5f15c5497e..5180ff9ee1 100644 --- a/code/modules/lighting/lighting_turf.dm +++ b/code/modules/lighting/lighting_turf.dm @@ -116,7 +116,7 @@ corners[i] = new/datum/lighting_corner(src, LIGHTING_CORNER_DIAGONAL[i]) /turf/ChangeTurf(path) - if(!path || (!use_preloader && path == type)) //Sucks this is here but it would cause problems otherwise. + if(!path || (!use_preloader && path == type) || !global.lighting_overlays_initialized) //Sucks this is here but it would cause problems otherwise. return ..() if (!lighting_corners_initialised)