From 52d8708f621f72fb8a8b8026f08a1f7a59d437e5 Mon Sep 17 00:00:00 2001
From: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com>
Date: Thu, 16 May 2024 19:55:32 -0400
Subject: [PATCH] [S] Fixes a matter eater exploit (#25500)
* adjacent
* add spaces
* double precautions
* wrong else
---
code/game/dna/mutations/mutation_powers.dm | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/code/game/dna/mutations/mutation_powers.dm b/code/game/dna/mutations/mutation_powers.dm
index 0c974c59d64b..da930664a2ce 100644
--- a/code/game/dna/mutations/mutation_powers.dm
+++ b/code/game/dna/mutations/mutation_powers.dm
@@ -394,6 +394,9 @@
return
var/atom/movable/the_item = targets[1]
+ if(!user.Adjacent(the_item))
+ to_chat(user, "You need to be next to [the_item] for this!")
+ return FALSE
if(ishuman(the_item))
var/mob/living/carbon/human/H = the_item
var/obj/item/organ/external/limb = H.get_organ(user.zone_selected)
@@ -412,15 +415,14 @@
revert_cast()
return FALSE
user.visible_message("[user] begins stuffing [the_item]'s [limb.name] into [user.p_their()] gaping maw!")
- var/oldloc = H.loc
- if(!do_mob(user,H,EAT_MOB_DELAY))
+ if(!do_mob(user, H, EAT_MOB_DELAY))
to_chat(user, "You were interrupted before you could eat [the_item]!")
else
if(!limb || !H)
return
- if(H.loc != oldloc)
- to_chat(user, "\The [limb] moved away from your mouth!")
- return
+ if(!user.Adjacent(the_item))
+ to_chat(user, "You need to be next to [the_item] for this!")
+ return FALSE
user.visible_message("[user] [pick("chomps","bites")] off [the_item]'s [limb]!")
playsound(user.loc, 'sound/items/eatfood.ogg', 50, 0)