mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-12 03:02:54 +00:00
Removes a very large amount of world loops. Adds a macro to painlessly generate a global list, and the needed code to modify the list when an object is made or deleted automatically. Cleans up some commented out code.
25 lines
638 B
Plaintext
25 lines
638 B
Plaintext
// Create lighting overlays on all turfs with dynamic lighting in areas with dynamic lighting.
|
|
/proc/create_all_lighting_overlays()
|
|
for(var/area/A in all_areas)
|
|
if(!A.dynamic_lighting)
|
|
continue
|
|
for(var/turf/T in A)
|
|
if(!T.dynamic_lighting)
|
|
continue
|
|
new /atom/movable/lighting_overlay(T, TRUE)
|
|
CHECK_TICK
|
|
CHECK_TICK
|
|
|
|
/proc/create_lighting_overlays_zlevel(var/zlevel)
|
|
ASSERT(zlevel)
|
|
|
|
for(var/turf/T in block(locate(1, 1, zlevel), locate(world.maxx, world.maxy, zlevel)))
|
|
if(!T.dynamic_lighting)
|
|
continue
|
|
|
|
var/area/A = T.loc
|
|
if(!A.dynamic_lighting)
|
|
continue
|
|
|
|
new /atom/movable/lighting_overlay(T, TRUE)
|