From edf049d9532f9ea19ea2dcc222d2e30e1d80e69b Mon Sep 17 00:00:00 2001 From: Jacquerel Date: Thu, 13 Mar 2025 11:34:35 +0000 Subject: [PATCH] Clear detached holder before moving assembly (#89946) ## About The Pull Request If you attached a proximity sensor to a wire and then detached it again, it would cause a runtime. This is because when the proximity sensor moved into your tile it would trigger and attempt to pulse, despite not being attached to anything To prevent this, we clear its `holder` variable before moving it so that it knows that there actually isn't anything for it to pulse ## Changelog Not sure this actually had any player facing effect other than creating a runtime error --- code/modules/assembly/assembly.dm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/code/modules/assembly/assembly.dm b/code/modules/assembly/assembly.dm index 5e1467e41b0..5794720b0cf 100644 --- a/code/modules/assembly/assembly.dm +++ b/code/modules/assembly/assembly.dm @@ -54,9 +54,10 @@ connected = null if(!holder) return FALSE - forceMove(holder.drop_location()) - SEND_SIGNAL(src, COMSIG_ASSEMBLY_DETACHED, holder) + var/atom/was_holder = holder holder = null + forceMove(was_holder.drop_location()) + SEND_SIGNAL(src, COMSIG_ASSEMBLY_DETACHED, was_holder) return TRUE /**