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