Skip to content

Commit

Permalink
Fix lighting on maps loaded after SSlighting init
Browse files Browse the repository at this point in the history
  • Loading branch information
out-of-phaze committed Jan 23, 2025
1 parent 42ac5a3 commit 7d48a5f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion code/controllers/subsystems/lighting.dm
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ SUBSYSTEM_DEF(lighting)
var/datum/level_data/level = SSmapping.levels_by_z[zlevel]
for (var/turf/tile as anything in block(1, 1, zlevel, level.level_max_width, level.level_max_height)) // include TRANSITIONEDGE turfs
if (TURF_IS_DYNAMICALLY_LIT_UNSAFE(tile))
tile.lighting_build_overlay()
new /atom/movable/lighting_overlay(tile)
overlaycount++
CHECK_TICK

Expand Down
4 changes: 4 additions & 0 deletions code/game/turfs/turf.dm
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@
else if (permit_ao)
queue_ao()

// we're being loaded in a new z-level, we need to build lighting
if(mapload && !changing_turf && SSlighting.initialized)
lighting_build_overlay()

if(simulated)
updateVisibility(src, FALSE)

Expand Down
1 change: 1 addition & 0 deletions code/game/turfs/unsimulated.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
initial_gas = GAS_STANDARD_AIRMIX
abstract_type = /turf/unsimulated
simulated = FALSE
dynamic_lighting = FALSE

// Shortcut a bunch of simulation stuff since this turf just needs to sit there.
// We don't even call Initialize(), how cool is that???
Expand Down

0 comments on commit 7d48a5f

Please sign in to comment.