From 5342438ec3d615b5af3d0263cfed5e46881a96d6 Mon Sep 17 00:00:00 2001 From: GoldenAlpharex <58045821+GoldenAlpharex@users.noreply.github.com> Date: Mon, 22 Nov 2021 11:16:23 -0500 Subject: [PATCH] Forces areas to create their lighting objects when loaded from a map template (#62931) Continues the journey of #61730. This time, all map templates will see their area lighting objects created upon getting loaded if they have static_lighting = TRUE. This means that places like Hilbert's hotel, as well as any map placed by an admin during the round, will now be able to properly have dynamic lights without any need for VV shenanigans. Tested and working, I tested with Hilbert's hotel and by spawning a couple of other map templates to confirm. Fixes #61558, closes #61340 (kinda not, but it's already fixed anyway, and loosely related to this) and should be the final nail in the coffin of #61349. Courtesy ping to @TiviPlus, just in case you had anything to say about it. --- code/modules/mapping/map_template.dm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/code/modules/mapping/map_template.dm b/code/modules/mapping/map_template.dm index 6645582c7b6..621c1a8e54f 100644 --- a/code/modules/mapping/map_template.dm +++ b/code/modules/mapping/map_template.dm @@ -82,6 +82,14 @@ SSatoms.InitializeAtoms(areas + turfs + movables, returns_created_atoms ? created_atoms : null) + for(var/turf/unlit as anything in turfs) + if(unlit.always_lit) + continue + var/area/loc_area = unlit.loc + if(!loc_area.static_lighting) + continue + unlit.lighting_build_overlay() + // NOTE, now that Initialize and LateInitialize run correctly, do we really // need these two below? SSmachines.setup_template_powernets(cables)