Files
MrMelbertandGitHub 18a1d31ca2 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
2026-07-10 22:39:25 -06:00

22 lines
595 B
Plaintext

SUBSYSTEM_DEF(sound_tokens)
name = "Sound Tokens"
wait = 1
ss_flags = SS_TICKER | SS_BACKGROUND | SS_NO_INIT
var/list/clients_needing_update = list()
var/list/currentrun = list()
/datum/controller/subsystem/sound_tokens/fire(resumed)
if(!resumed)
currentrun = clients_needing_update
clients_needing_update = list()
while(length(currentrun))
var/client/client = currentrun[currentrun.len]
currentrun.len--
var/mob/owned_mob = client.mob
for(var/datum/sound_token/token as anything in owned_mob?.sound_tokens)
token.update_listener(owned_mob)
if(MC_TICK_CHECK)
break