Clears reference to parent when removing external organs

This commit is contained in:
mwerezak
2015-12-06 03:57:15 -05:00
parent a7d80a93e5
commit 5de9314803
+8 -5
View File
@@ -711,22 +711,21 @@ Note that amputating the affected organ does in fact remove the infection from t
"<span class='danger'>You hear the sickening splatter of gore.</span>")
var/mob/living/carbon/human/victim = owner //Keep a reference for post-removed().
var/obj/item/organ/external/parent_organ = parent
removed(null, ignore_children)
victim.traumatic_shock += 60
wounds.Cut()
if(parent)
if(parent_organ)
var/datum/wound/lost_limb/W = new (src, disintegrate, clean)
parent.children -= src
if(clean)
parent.wounds |= W
parent.update_damages()
parent_organ.wounds |= W
parent_organ.update_damages()
else
var/obj/item/organ/external/stump/stump = new (victim, 0, src)
stump.wounds |= W
victim.organs |= stump
stump.update_damages()
parent = null
spawn(1)
victim.updatehealth()
@@ -974,6 +973,10 @@ Note that amputating the affected organ does in fact remove the infection from t
organ.removed()
organ.loc = src
// Remove parent references
parent.children -= src
parent = null
release_restraints(victim)
victim.organs -= src
victim.organs_by_name[limb_name] = null // Remove from owner's vars.