Mob Destroy Refactoring (#22573)

Refactoring the entire destroy proc path from Mob Human all the way down
to Atom while trying to find the causes for the damn mob human hard
deletes. This PR comprehensively reorganizes every single stray
snowflake var used by /atom/ all the way to /mob/living/carbon/human,
and makes sure that every var that COULD store a reference, is now
cleared during the entirety of the Mob Destroy() parent hierarchy.

This may very well be the end of the lag war. 

In total, I've hunted down and cleared 39 hanging references between
/atom and /mob/living/carbon/human

---------

Signed-off-by: VMSolidus <evilexecutive@gmail.com>
This commit is contained in:
VMSolidus
2026-06-03 15:15:56 +00:00
committed by GitHub
parent 7799ea7355
commit 201592f6bd
58 changed files with 383 additions and 345 deletions
@@ -122,9 +122,6 @@
return
return loc
/mob
var/mob/abstract/eye/eyeobj
/mob/proc/EyeMove(n, direct)
if(!eyeobj)
return
+2 -1
View File
@@ -6,7 +6,7 @@
/// This variable generally controls whether a ghost has restrictions on where it can go or not (ex. if the ghost can bypass holy places).
var/has_ghost_restrictions = TRUE
/// If the ghost has antagHUD.
var/antagHUD = 0
var/antagHUD = FALSE
/// Necessary for seeing wires.
var/obj/item/multitool/ghost_multitool
/// The POI we're orbiting.
@@ -22,6 +22,7 @@
/mob/abstract/ghost/Destroy()
QDEL_NULL(ghost_multitool)
orbiting_ref = null
return ..()
/mob/abstract/ghost/Topic(href, href_list)
@@ -22,17 +22,17 @@
/// This variable is set to 1 when you enter the game as an observer. Remains null if you died in the game and are a ghost. Not reliable for admins; they change mobs a lot.
var/started_as_observer
/// If the ghost has enabled antagHUD.
var/has_enabled_antagHUD = 0
var/has_enabled_antagHUD = FALSE
/// If the ghost has enabled medHUD.
var/medHUD = 0
var/medHUD = FALSE
/// If this is an adminghost.
var/admin_ghosted = 0
var/admin_ghosted = FALSE
/// If this ghost has enabled chat anonymization.
var/anonsay = 0
var/anonsay = FALSE
/// If the ghost can be seen through cult shenanigans.
var/is_manifest = 0
var/is_manifest = FALSE
/// Cooldown for ghost abilities, such as move_item().
var/ghost_cooldown = 0
var/ghost_cooldown = FALSE
/mob/abstract/ghost/observer/Initialize(mapload, mob/body)
. = ..()
@@ -87,12 +87,21 @@
src.LoadComponent(/datum/component/health_analyzer/observer)
/mob/abstract/ghost/observer/Destroy()
if(client)
// Handling client images
if(client && length(client.images))
for(var/image/I in client.images)
if(I.loc == src)
qdel(I)
// Something deleted the image, clear it and move on.
if (!istype(I) || QDELETED(I))
client.images -= I
continue
if(I.loc != src)
continue
qdel(I)
client.images -= I
QDEL_NULL(hud)
mind = null
return ..()
/mob/abstract/ghost/observer/proc/initialise_postkey(set_timers = TRUE)