From 12330c7ca3321eb1598933cd449ea1b6dfcbb129 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Sun, 7 Jan 2024 08:45:12 +0100 Subject: [PATCH] [MIRROR] Fixing a runtime with H.A.R.S. [MDB IGNORE] (#26027) * Fixing a runtime with H.A.R.S. (#80772) ## About The Pull Request The brain gets moved into the chest with H.A.R.S. now, but the bodypart insertion and removal procs for it still asume it can only be found in the head. This should fix it. For the sake of preventing similar issues in the future, I've also updated the pretty-much-identical versions for ears, eyes and tongue. I've checked, and the brain var is only used by the head for visuals and examine strings. * Fixing a runtime with H.A.R.S. --------- Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com> --- .../surgery/bodyparts/dismemberment.dm | 40 +++++++++++-------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/code/modules/surgery/bodyparts/dismemberment.dm b/code/modules/surgery/bodyparts/dismemberment.dm index 48e6a77c3bb..74725fbc55c 100644 --- a/code/modules/surgery/bodyparts/dismemberment.dm +++ b/code/modules/surgery/bodyparts/dismemberment.dm @@ -190,36 +190,44 @@ return dismembering.apply_dismember(src, wounding_type) /obj/item/organ/internal/eyes/on_bodypart_insert(obj/item/bodypart/head/head) - head.eyes = src - ..() + if(istype(head)) + head.eyes = src + return ..() /obj/item/organ/internal/ears/on_bodypart_insert(obj/item/bodypart/head/head) - head.ears = src - ..() + if(istype(head)) + head.ears = src + return ..() /obj/item/organ/internal/tongue/on_bodypart_insert(obj/item/bodypart/head/head) - head.tongue = src - ..() + if(istype(head)) + head.tongue = src + return ..() /obj/item/organ/internal/brain/on_bodypart_insert(obj/item/bodypart/head/head) - head.brain = src - ..() + if(istype(head)) + head.brain = src + return ..() /obj/item/organ/internal/eyes/on_bodypart_remove(obj/item/bodypart/head/head) - head.eyes = null - ..() + if(istype(head)) + head.eyes = null + return ..() /obj/item/organ/internal/ears/on_bodypart_remove(obj/item/bodypart/head/head) - head.ears = null - ..() + if(istype(head)) + head.ears = null + return ..() /obj/item/organ/internal/tongue/on_bodypart_remove(obj/item/bodypart/head/head) - head.tongue = null - ..() + if(istype(head)) + head.tongue = null + return ..() /obj/item/organ/internal/brain/on_bodypart_remove(obj/item/bodypart/head/head) - head.brain = null - ..() + if(istype(head)) + head.brain = null + return ..() /obj/item/bodypart/chest/drop_limb(special, dismembered, move_to_floor = TRUE) if(special)