From 2794a07c0b2145eee392cd778822377aad2becf6 Mon Sep 17 00:00:00 2001 From: CabinetOnFire Date: Sun, 14 Jun 2026 21:31:25 +0200 Subject: [PATCH] Fixes a signal override for Sound Tokens and potentially fixes a harddel when clients logged out while hearing sound tokens (#96472) :cl: fix: Fixes a hard-del and signal override with sound tokens /:cl: The comsig issue was basically: both source and listener register for qdel, but they can be the same thing resulting in a double register. lame! the hard-del was caused by me running remove_listener when a client logged out of a mob...but at that point the client is null...so we cant clear its sound tokens. boo! not smart! --- code/datums/sound_token.dm | 4 +++- code/modules/client/client_procs.dm | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/code/datums/sound_token.dm b/code/datums/sound_token.dm index 93fdfb8213b..516d1c272aa 100644 --- a/code/datums/sound_token.dm +++ b/code/datums/sound_token.dm @@ -53,6 +53,7 @@ RegisterSignal(SSdcs, COMSIG_GLOB_PLAYER_LOGIN, PROC_REF(player_login)) RegisterSignal(SSdcs, COMSIG_GLOB_PLAYER_LOGOUT, PROC_REF(player_logout)) + /datum/sound_token/Destroy(force, ...) for(var/listener in listeners) remove_listener(listener) @@ -89,7 +90,8 @@ listeners[listener_mob] = NONE listener_mob.client.sound_tokens += src - RegisterSignal(listener_mob, COMSIG_QDELETING, PROC_REF(listener_deleted)) + if(source != listener_mob) //this is possible...yea... :/ + RegisterSignal(listener_mob, COMSIG_QDELETING, PROC_REF(listener_deleted)) RegisterSignals(listener_mob, list(SIGNAL_ADDTRAIT(TRAIT_DEAF), SIGNAL_REMOVETRAIT(TRAIT_DEAF)), PROC_REF(listener_deafness_update)) update_listener(listener_mob, FALSE) return TRUE diff --git a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm index ff0077c7251..20693fc1bed 100644 --- a/code/modules/client/client_procs.dm +++ b/code/modules/client/client_procs.dm @@ -632,6 +632,8 @@ GLOBAL_LIST_INIT(unrecommended_builds, list( QDEL_LIST_ASSOC_VAL(char_render_holders) + sound_tokens = null + SSambience.remove_ambience_client(src) SSmouse_entered.hovers -= src SSping.currentrun -= src @@ -643,6 +645,7 @@ GLOBAL_LIST_INIT(unrecommended_builds, list( QDEL_NULL(loot_panel) QDEL_NULL(parallax_rock) seen_messages = null + sound_tokens = null Master.UpdateTickRate() ..() //Even though we're going to be hard deleted there are still some things that want to know the destroy is happening return QDEL_HINT_HARDDEL_NOW