Files
VMSolidus 1fbead50af Mob Ref Cleanup Part 3 (#22599)
Part 3 of the Mob Destroy Refactor, this time going through the entire
list of every ref stored up to a mob/human, and (attempting) to verify
and cleanup every possible circular ref. This PR also fixes some
mistakes made with cleaning up UI elements, namely that tgui's really
don't like it when you qdel them, and screen objects also weren't always
clearing their own references if Qdel'ed directly. There were several
niche situations too where circle refs might be retained by a mob. I
also found an issue where static lights were only cleaned up on
/atom/movable/ but actually existed farther up the chain on /atom. I
don't know if any /atoms that aren't /atom/movable ever get static
lights, but the fact that they can be needs to be correctly accounted
for.

I can't possibly have gotten all of them, but this is every single one I
could find after 3 hours of work.
2026-06-11 10:47:56 +00:00

19 lines
551 B
Plaintext

///Pretty simple, just updates static lights on this atom
/atom/proc/static_update_light()
set waitfor = FALSE
if (QDELETED(src))
return
if (!light_power || !light_range) // We won't emit light anyways, destroy the light source.
QDEL_NULL(static_light)
else
if(!ismovableatom(loc)) // We choose what atom should be the top atom of the light here.
. = src
else
. = loc
if(static_light) // Update the light or create it if it does not exist.
static_light.update(.)
else
static_light = new/datum/static_light_source(src, .)