Bioaug Hard Del Fix (#22273)

This PR fixes a hard del related to any kind of direct organ replacement
via loadouts, which it turns out all of them were doing. But it was most
commonly showing up with bioaugs because the boosted heart and boosted
liver are the only organs besides custom items that replace an internal
organ during loadouts spawning.
This commit is contained in:
VMSolidus
2026-04-19 01:28:15 -04:00
committed by GitHub
parent 83f2c7922a
commit fbcaf7168d
3 changed files with 16 additions and 3 deletions
+6 -3
View File
@@ -82,6 +82,8 @@ INITIALIZE_IMMEDIATE(/obj/item/organ)
/obj/item/organ/Destroy()
STOP_PROCESSING(SSprocessing, src)
QDEL_NULL(dna)
if(!owner)
return ..()
@@ -90,14 +92,15 @@ INITIALIZE_IMMEDIATE(/obj/item/organ)
owner.internal_organs -= src
if(istype(owner, /mob/living/carbon/human))
if(owner.internal_organs_by_name)
owner.internal_organs_by_name -= src
owner.internal_organs_by_name[organ_tag] = null
owner.internal_organs_by_name -= organ_tag
if(owner.organs)
owner.organs -= src
if(owner.organs_by_name)
owner.organs_by_name -= src
owner.organs_by_name[organ_tag] = null
owner.organs_by_name -= organ_tag
owner = null
QDEL_NULL(dna)
return ..()