Merge pull request #2621 from CHOMPStationBot/upstream-merge-11165

[MIRROR] Small light optimizations
This commit is contained in:
Nadyr
2021-07-20 21:26:15 -04:00
committed by GitHub
2 changed files with 7 additions and 1 deletions

View File

@@ -182,9 +182,12 @@
if(!current_holder) if(!current_holder)
return return
var/atom/movable/light_source = GET_LIGHT_SOURCE var/atom/movable/light_source = GET_LIGHT_SOURCE
. = list()
for(var/turf/lit_turf in view(lumcount_range, get_turf(light_source))) for(var/turf/lit_turf in view(lumcount_range, get_turf(light_source)))
lit_turf.dynamic_lumcount += lum_power lit_turf.dynamic_lumcount += lum_power
LAZYADD(affected_turfs, lit_turf) . += lit_turf
if(length(.))
affected_turfs = .
///Clears the old affected turfs and populates the new ones. ///Clears the old affected turfs and populates the new ones.

View File

@@ -41,6 +41,7 @@
var/old_directional_opacity = directional_opacity var/old_directional_opacity = directional_opacity
var/old_outdoors = outdoors var/old_outdoors = outdoors
var/old_dangerous_objects = dangerous_objects var/old_dangerous_objects = dangerous_objects
var/old_dynamic_lumcount = dynamic_lumcount
var/turf/Ab = GetAbove(src) var/turf/Ab = GetAbove(src)
if(Ab) if(Ab)
@@ -111,6 +112,8 @@
lighting_corner_SW = old_lighting_corner_SW lighting_corner_SW = old_lighting_corner_SW
lighting_corner_NW = old_lighting_corner_NW lighting_corner_NW = old_lighting_corner_NW
dynamic_lumcount = old_dynamic_lumcount
if(SSlighting.subsystem_initialized) if(SSlighting.subsystem_initialized)
lighting_object = old_lighting_object lighting_object = old_lighting_object