From 170d7f9efebebf12d30a9bdcc54f694086056962 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Mon, 22 Nov 2021 16:31:37 +0000 Subject: [PATCH] [MIRROR] Forces areas to create their lighting objects when loaded from a map template [MDB IGNORE] (#9614) * 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. * Forces areas to create their lighting objects when loaded from a map template Co-authored-by: GoldenAlpharex <58045821+GoldenAlpharex@users.noreply.github.com> --- 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)