mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 12:41:09 +01:00
## 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
22 lines
595 B
Plaintext
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
|