From b3d1af2866fc09935d2ff936594da3bccd70b6a8 Mon Sep 17 00:00:00 2001 From: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com> Date: Wed, 2 Jun 2021 17:28:55 -0700 Subject: [PATCH] Unregistering with a list of lists will fail, but not loudly, which causes some really painful errors. Let's make a stack trace for it, and fix the one case I know of (#59434) --- code/datums/components/_component.dm | 2 ++ code/datums/elements/movetype_handler.dm | 10 ++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/code/datums/components/_component.dm b/code/datums/components/_component.dm index 6a47cd86fc4..6264fd54dbf 100644 --- a/code/datums/components/_component.dm +++ b/code/datums/components/_component.dm @@ -221,6 +221,8 @@ sig_type_or_types = list(sig_type_or_types) for(var/sig in sig_type_or_types) if(!signal_procs[target][sig]) + if(!istext(sig)) + stack_trace("We're unregistering with something that isn't a valid signal \[[sig]\], you fucked up") continue switch(length(lookup[sig])) if(2) diff --git a/code/datums/elements/movetype_handler.dm b/code/datums/elements/movetype_handler.dm index 6bfb0d5969e..d3e81f45cdf 100644 --- a/code/datums/elements/movetype_handler.dm +++ b/code/datums/elements/movetype_handler.dm @@ -33,13 +33,15 @@ DO_FLOATING_ANIM(movable_target) /datum/element/movetype_handler/Detach(datum/source) - UnregisterSignal(source, list( - GLOB.movement_type_addtrait_signals, - GLOB.movement_type_removetrait_signals, + var/list/signals_to_remove = list( SIGNAL_ADDTRAIT(TRAIT_NO_FLOATING_ANIM), SIGNAL_REMOVETRAIT(TRAIT_NO_FLOATING_ANIM), COMSIG_PAUSE_FLOATING_ANIM - )) + ) + signals_to_remove += GLOB.movement_type_addtrait_signals + signals_to_remove += GLOB.movement_type_removetrait_signals + UnregisterSignal(source, signals_to_remove) + attached_atoms -= source paused_floating_anim_atoms -= source stop_floating(source)