diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index bbdfc331c2c..a373797e805 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -43,8 +43,10 @@ QDEL_NULL(bloodstr) QDEL_NULL(dna) QDEL_NULL(breathing) - for(var/guts in internal_organs) - qdel(guts) + // Delete and null a direct list of references to our internal organs (such as brain, lungs, heart, etc). + QDEL_LIST(internal_organs) + // Null an Associative list of String = Reference to the same organs. + internal_organs_by_name = null return ..() /mob/living/carbon/rejuvenate() diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 0e51229532a..d4c378544e8 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -114,9 +114,10 @@ GLOB.human_mob_list -= src GLOB.intent_listener -= src + // This is apparently a different list entirely from the list of organs on /mob/living/carbon. + // It's actually the set of all Limbs (left arm, head, leg leg, etc) we have. We Qdel and null the set of all limbs, which is unique to /human. QDEL_LIST(organs) - internal_organs_by_name = null - internal_organs = null + // Then also null the associative list of those same limbs, which contains the same references. organs_by_name = null bad_internal_organs = null bad_external_organs = null diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 372fdcaa6a6..405c0134cdf 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -4,7 +4,10 @@ /mob/Destroy()//This makes sure that mobs with clients/keys are not just deleted from the game. MOB_STOP_THINKING(src) - + // Tell any mobs touching us that they're not pulling us anymore. + stop_pulling() + // Delete and null the grab objects that are touching this mob. + QDEL_LIST(grabbed_by) GLOB.mob_list -= src GLOB.dead_mob_list -= src GLOB.living_mob_list -= src diff --git a/html/changelogs/hellfirejag-human-hard-del-fix.yml b/html/changelogs/hellfirejag-human-hard-del-fix.yml new file mode 100644 index 00000000000..03ed25e363b --- /dev/null +++ b/html/changelogs/hellfirejag-human-hard-del-fix.yml @@ -0,0 +1,4 @@ +author: Hellfirejag +delete-after: True +changes: + - bugfix: "Fixed a hard delete related to human mobs."