From 0ee0779bfd3cff971d1f5172910d48e6ce11504a Mon Sep 17 00:00:00 2001 From: MistakeNot4892 Date: Wed, 24 Feb 2021 10:21:34 +1100 Subject: [PATCH] Properly cleared ORGAN_CUT_AWAY for prosthetics. --- .../modules/mob/living/carbon/human/human_modular_limbs.dm | 5 +++++ code/modules/surgery/limb_reattach.dm | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/code/modules/mob/living/carbon/human/human_modular_limbs.dm b/code/modules/mob/living/carbon/human/human_modular_limbs.dm index aab466dae7..471e8a42cd 100644 --- a/code/modules/mob/living/carbon/human/human_modular_limbs.dm +++ b/code/modules/mob/living/carbon/human/human_modular_limbs.dm @@ -154,7 +154,12 @@ last_special = world.time drop_from_inventory(E) E.replaced(src) + + // Reconnect the organ and children as normally this is done with surgery. E.status &= ~ORGAN_CUT_AWAY + for(var/obj/item/organ/external/child in E.children) + child.status &= ~ORGAN_CUT_AWAY + var/datum/gender/G = gender_datums[gender] visible_message( SPAN_NOTICE("\The [src] attaches \the [E] to [G.his] body!"), diff --git a/code/modules/surgery/limb_reattach.dm b/code/modules/surgery/limb_reattach.dm index 300616499f..0219149996 100644 --- a/code/modules/surgery/limb_reattach.dm +++ b/code/modules/surgery/limb_reattach.dm @@ -59,6 +59,13 @@ "You have attached [target]'s [E.name] to the [E.amputation_point].") user.drop_from_inventory(E) E.replaced(target) + + // Modular bodyparts (like prosthetics) do not need to be reconnected. + if(E.get_modular_limb_category() != MODULAR_BODYPART_INVALID) + E.status &= ~ORGAN_CUT_AWAY + for(var/obj/item/organ/external/child in E.children) + child.status &= ~ORGAN_CUT_AWAY + target.update_icons_body(FALSE) target.updatehealth() target.UpdateDamageIcon()