Skip to content

Commit

Permalink
Fixes fake incomplete surgery (#4552)
Browse files Browse the repository at this point in the history
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->

# About the pull request

This PR closes #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
<!-- Include any screenshots/videos/debugging steps of the modified code
functioning successfully, ideally including edge cases. -->
<details>
<summary>Screenshots & Videos</summary>

Put screenshots and videos here with an empty line between the
screenshots and the `<details>` tags.

</details>


# Changelog

:cl: Morrow
fix: Fixed fake incomplete surgeries
/:cl:

<!-- Both :cl:'s are required for the changelog to work! -->
  • Loading branch information
morrowwolf committed Oct 1, 2023
1 parent 83a1b19 commit 21d51c5
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions code/modules/surgery/surgery_initiator.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 21d51c5

Please sign in to comment.