From 5c2f3170f5add96f04912713b3e0d7ef08a35138 Mon Sep 17 00:00:00 2001
From: GDN <96800819+GDNgit@users.noreply.github.com>
Date: Sat, 24 Feb 2024 14:14:00 -0600
Subject: [PATCH] [S] fixes a headslug exploit (#24300)
* fixes headslugs being able to double up on the dead
* Update code/modules/mob/living/simple_animal/hostile/headslug.dm
Co-authored-by: Contrabang <91113370+Contrabang@users.noreply.github.com>
---------
Co-authored-by: Contrabang <91113370+Contrabang@users.noreply.github.com>
---
.../mob/living/simple_animal/hostile/headslug.dm | 13 +++++++++----
code/modules/surgery/organs/organ_external.dm | 2 --
2 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/code/modules/mob/living/simple_animal/hostile/headslug.dm b/code/modules/mob/living/simple_animal/hostile/headslug.dm
index 735ca1d4bc7b..19137beaac9e 100644
--- a/code/modules/mob/living/simple_animal/hostile/headslug.dm
+++ b/code/modules/mob/living/simple_animal/hostile/headslug.dm
@@ -52,6 +52,9 @@
if(HAS_TRAIT(carbon_target, TRAIT_XENO_HOST))
to_chat(src, "A foreign presence repels us from this body. Perhaps we should try to infest another?")
return
+ if(!carbon_target.get_int_organ_datum(ORGAN_DATUM_HEART))
+ to_chat(src, "There's no heart for us to infest!")
+ return
Infect(carbon_target)
to_chat(src, "With our egg laid, our death approaches rapidly...")
addtimer(CALLBACK(src, PROC_REF(death)), 25 SECONDS)
@@ -114,11 +117,13 @@
owner.gib()
return
- owner.apply_damage(300, BRUTE, BODY_ZONE_CHEST)
owner.bleed(BLOOD_VOLUME_NORMAL)
- var/obj/item/organ/external/chest = owner.get_organ(BODY_ZONE_CHEST)
- chest.fracture()
- chest.disembowel()
+ var/datum/organ/our_heart_datum = owner.get_int_organ_datum(ORGAN_DATUM_HEART)
+ var/obj/item/organ/internal/our_heart = our_heart_datum.linked_organ
+ var/obj/item/organ/external/heart_location = owner.get_organ(our_heart.parent_organ)
+ owner.apply_damage(300, BRUTE, our_heart.parent_organ)
+ heart_location.fracture()
+ heart_location.disembowel(our_heart.parent_organ)
#undef EGG_INCUBATION_DEAD_CYCLE
#undef EGG_INCUBATION_LIVING_CYCLE
diff --git a/code/modules/surgery/organs/organ_external.dm b/code/modules/surgery/organs/organ_external.dm
index dc6da40ef36e..4468194ed880 100644
--- a/code/modules/surgery/organs/organ_external.dm
+++ b/code/modules/surgery/organs/organ_external.dm
@@ -656,8 +656,6 @@ Note that amputating the affected organ does in fact remove the infection from t
if(disembowel("groin"))
return TRUE
-
-
/obj/item/organ/external/attackby(obj/item/I, mob/user, params)
if(I.sharp)
add_fingerprint(user)