From 0dd5cb6fee44984723f93486b531abfa027d0258 Mon Sep 17 00:00:00 2001 From: Drathek <76988376+Drulikar@users.noreply.github.com> Date: Thu, 10 Aug 2023 03:54:56 -0700 Subject: [PATCH] Fix beams for IV drip machines when adding/removing a blood bag (#4145) # About the pull request This PR is a followup to #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
Screenshots & Videos Put screenshots and videos here with an empty line between the screenshots and the `
` tags.
# 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: --- code/game/machinery/iv_drip.dm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/code/game/machinery/iv_drip.dm b/code/game/machinery/iv_drip.dm index 0b2b01fdb918..ef6c74a052cd 100644 --- a/code/game/machinery/iv_drip.dm +++ b/code/game/machinery/iv_drip.dm @@ -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() . = ..()