Maybe fix sound token hard deletes (#96903)

## About The Pull Request

`remove_listener` would fail on logout so instead I figure we could
track the tokens on the mob, rather than the client

Functionally not much is changed - but if you go from ghost to mob it'll
remove the token from the ghost and adds the token to the new mob, so it
should fix the issue

There also doesn't need to be any code in `/mob/destroy` because we
listen for `listener_deleted` and remove listeners on the token itself
This commit is contained in:
MrMelbert
2026-07-10 22:39:25 -06:00
committed by GitHub
parent 25edacac7c
commit 18a1d31ca2
6 changed files with 8 additions and 19 deletions
+1 -4
View File
@@ -15,10 +15,7 @@ SUBSYSTEM_DEF(sound_tokens)
var/client/client = currentrun[currentrun.len]
currentrun.len--
var/mob/owned_mob = client.mob
if(!owned_mob)
continue
for(var/datum/sound_token/token in client.sound_tokens)
for(var/datum/sound_token/token as anything in owned_mob?.sound_tokens)
token.update_listener(owned_mob)
if(MC_TICK_CHECK)
break