Skip to content

Commit

Permalink
Fix beams for IV drip machines when adding/removing a blood bag (cmss…
Browse files Browse the repository at this point in the history
…13-devs#4145)

# About the pull request

This PR is a followup to cmss13-devs#3645 fixing the beam getting into an incorrect
state when adding/removing a bag when the drip is already connected to
someone. Also fixes a lingering reference to the attached mob ever the
drip is destroyed.

# Explain why it's good for the game

Fixes this: 


https://github.com/cmss13-devs/cmss13/assets/76988376/77a69934-0eb9-4322-b0c5-74a53a34700f

# Testing Photographs and Procedure
<details>
<summary>Screenshots & Videos</summary>

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

</details>


# Changelog
:cl: Drathek
fix: Fix IV Drip machines not displaying the IV line correctly when
adding/removing a bag when already attached
code: Fixes a lingering reference to the mob when a IV drip machine is
destroyed.
/:cl:
  • Loading branch information
Drulikar authored Aug 10, 2023
1 parent f5b7de8 commit 0dd5cb6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions code/game/machinery/iv_drip.dm
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,14 @@
overlays += filling

/obj/structure/machinery/iv_drip/proc/update_beam()
if(current_beam)
if(current_beam && !attached)
QDEL_NULL(current_beam)
else if(!QDELETED(src) && attached)
else if(!current_beam && attached && !QDELETED(src))
current_beam = beam(attached, "iv_tube")

/obj/structure/machinery/iv_drip/Destroy()
attached?.active_transfusions -= src
attached = null
update_beam()
. = ..()

Expand Down

0 comments on commit 0dd5cb6

Please sign in to comment.