From 21d51c5e2cdc1e3029ecc8883282177f3e545bab Mon Sep 17 00:00:00 2001 From: morrowwolf Date: Sun, 1 Oct 2023 12:42:11 -0400 Subject: [PATCH] Fixes fake incomplete surgery (#4552) # About the pull request This PR closes https://github.com/cmss13-devs/cmss13/issues/4548 We need two of these checks in both the initial checks and then after an input before we even start the surgery so we don't have a hanging pretend surgery. # Explain why it's good for the game Bug bad # Testing Photographs and Procedure
Screenshots & Videos Put screenshots and videos here with an empty line between the screenshots and the `
` tags.
# Changelog :cl: Morrow fix: Fixed fake incomplete surgeries /:cl: --- code/modules/surgery/surgery_initiator.dm | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/code/modules/surgery/surgery_initiator.dm b/code/modules/surgery/surgery_initiator.dm index 08b4dbdfed60..8b7506c9b7b8 100644 --- a/code/modules/surgery/surgery_initiator.dm +++ b/code/modules/surgery/surgery_initiator.dm @@ -27,6 +27,13 @@ to_chat(user, SPAN_WARNING("You can't perform surgery under these bad conditions!")) return FALSE + var/obj/limb/surgery_limb = target.get_limb(target_zone) + if(surgery_limb) + var/obj/item/blocker = target.get_sharp_obj_blocker(surgery_limb) + if(blocker) + to_chat(user, SPAN_WARNING("[blocker] [target] is wearing restricts your access to the surgical site, take it off!")) + return + if(user.action_busy) //already doing an action return FALSE @@ -130,6 +137,12 @@ if(surgeryinstance.lying_required && !target.lying) return TRUE + if(surgery_limb) + var/obj/item/blocker = target.get_sharp_obj_blocker(surgery_limb) + if(blocker) + to_chat(user, SPAN_WARNING("[blocker] [target] is wearing restricts your access to the surgical site, take it off!")) + return + if(affecting) if(surgeryinstance.requires_bodypart) if(affecting.status & LIMB_DESTROYED)