Consolidates some /Destroy()s to make them properly delete (#17046)

* The mob/living/Destroy() consolidation

* The mob/Destroy() consolidation

* The /mob/living/carbon/human consolidation

* The datum/Destroy() Consolidation

* The /atom/movable/Destroy() Consolidation

* for human
This commit is contained in:
Cameron Lennox
2025-02-14 03:06:25 +01:00
committed by GitHub
parent 900d0144a7
commit b1fc0d4c70
19 changed files with 47 additions and 84 deletions
-4
View File
@@ -113,10 +113,6 @@
/mob/living
var/list/modifiers = list() // A list of modifier datums, which can adjust certain mob numbers.
/mob/living/Destroy()
remove_all_modifiers(TRUE)
return ..()
// Called by Life().
/mob/living/proc/handle_modifiers()
if(!modifiers.len) // No work to do.
@@ -581,12 +581,6 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
/mob
var/list/following_mobs = list()
/mob/Destroy()
for(var/mob/observer/dead/M in following_mobs)
M.stop_following()
following_mobs = null
return ..()
/mob/observer/dead/Destroy()
visualnet.addVisibility(src, src.client)
visualnet = null
@@ -22,10 +22,6 @@
..()
cultnet.updateVisibility(src, 0)
/mob/living/Destroy()
cultnet.updateVisibility(src, 0)
return ..()
/mob/living/rejuvenate()
var/was_dead = stat == DEAD
..()
@@ -75,12 +75,17 @@
QDEL_NULL_LIST(organs)
if(nif)
QDEL_NULL(nif)
alt_farmanimals -= src
worn_clothing.Cut()
if(stored_blob)
stored_blob.drop_l_hand()
stored_blob.drop_r_hand()
QDEL_NULL(stored_blob)
if(vessel)
QDEL_NULL(vessel)
return ..()
. = ..()
/mob/living/carbon/human/get_status_tab_items()
. = ..()
@@ -7,11 +7,6 @@
img.override = TRUE
add_alt_appearance("animals", img, displayTo = alt_farmanimals)
/mob/living/carbon/human/Destroy()
alt_farmanimals -= src
. = ..()
/mob/living/carbon/human/get_digestion_nutrition_modifier()
return species.digestion_nutrition_modifier
@@ -75,13 +75,6 @@
set_light(0)
return ..()
/mob/living/carbon/human/Destroy()
if(stored_blob)
stored_blob.drop_l_hand()
stored_blob.drop_r_hand()
QDEL_NULL(stored_blob)
return ..()
/mob/living/simple_mob/slime/promethean/update_misc_tabs()
. = ..()
if(humanform)
+28 -1
View File
@@ -19,6 +19,26 @@
selected_image = image(icon = buildmode_hud, loc = src, icon_state = "ai_sel")
/mob/living/Destroy()
SSradiation.listeners -= src
remove_all_modifiers(TRUE)
QDEL_NULL(say_list)
for(var/datum/soul_link/S as anything in owned_soul_links)
S.owner_died(FALSE)
qdel(S) // If the owner is destroy()'d, the soullink is destroy()'d.
owned_soul_links = null
for(var/datum/soul_link/S as anything in shared_soul_links)
S.sharer_died(FALSE)
S.remove_soul_sharer(src) // If a sharer is destroy()'d, they are simply removed.
shared_soul_links = null
if(ai_holder)
ai_holder.holder = null
ai_holder.UnregisterSignal(src,COMSIG_MOB_STATCHANGE)
if(ai_holder.faction_friends && ai_holder.faction_friends.len) //This list is shared amongst the faction
ai_holder.faction_friends -= src
ai_holder.faction_friends = null
QDEL_NULL(ai_holder)
if(dsoverlay)
dsoverlay.loc = null //I'll take my coat with me
dsoverlay = null
@@ -78,7 +98,14 @@
internal_organs -= OR
qdel(OR)
return ..()
cultnet.updateVisibility(src, 0)
if(aiming)
qdel(aiming)
aiming = null
aimed.Cut()
. = ..()
//mob verbs are faster than object verbs. See mob/verb/examine.
/mob/living/verb/pulled(atom/movable/AM as mob|obj in oview(1))
+7 -1
View File
@@ -1,4 +1,5 @@
/mob/Destroy()//This makes sure that mobs withGLOB.clients/keys are not just deleted from the game.
SSmobs.currentrun -= src
mob_list -= src
dead_mob_list -= src
living_mob_list -= src
@@ -23,12 +24,17 @@
if(pulling)
stop_pulling() //TG does this on atom/movable but our stop_pulling proc is here so whatever
vore_selected = null
if(ability_master)
QDEL_NULL(ability_master)
if(vore_organs)
QDEL_NULL_LIST(vore_organs)
if(vorePanel)
QDEL_NULL(vorePanel)
for(var/mob/observer/dead/M in following_mobs)
M.stop_following()
following_mobs = null
previewing_belly = null // from code/modules/vore/eating/mob_ch.dm
vore_selected = null // from code/modules/vore/eating/mob_vr
focus = null