diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index 8332eef368b..681524ddcc3 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -577,11 +577,19 @@ /* END Spatial grid stuffs */ for(var/datum/dynamic_light_source/light as anything in hybrid_light_sources) + if(!light) // datum was deleted but list entry not yet pruned + LAZYREMOVE(hybrid_light_sources, light) + continue + if(!light.source_atom) + continue light.source_atom.update_light() if(!isturf(loc)) light.find_containing_atom() for(var/datum/static_light_source/L as anything in static_light_sources) // Cycle through the light sources on this atom and tell them to update. - L.source_atom.static_update_light() + if(!L) // datum was deleted but list entry not yet pruned + LAZYREMOVE(static_light_sources, L) + continue + L.source_atom?.static_update_light() /atom/movable/Exited(atom/movable/gone, direction) . = ..() diff --git a/html/changelogs/hellfirejag-dynamic-light-runtime.yml b/html/changelogs/hellfirejag-dynamic-light-runtime.yml new file mode 100644 index 00000000000..81ef6582cc2 --- /dev/null +++ b/html/changelogs/hellfirejag-dynamic-light-runtime.yml @@ -0,0 +1,4 @@ +author: Hellfirejag +delete-after: True +changes: + - bugfix: "Fixed a runtime regularly caused by flashlights."