From d12576371ccd86c0d8bf91c47922874ff13a9bac Mon Sep 17 00:00:00 2001 From: Afevis Date: Sat, 22 Jun 2024 12:24:44 -0400 Subject: [PATCH] Fixes ambient sound preferences runtiming every time a client connects (#84202) fixes #84200 forgot to pass the value that's sent while preferences are still initializing. --- code/modules/client/client_procs.dm | 6 +++--- code/modules/client/preferences/sounds.dm | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm index 37766aea223..66fde8c2f1a 100644 --- a/code/modules/client/client_procs.dm +++ b/code/modules/client/client_procs.dm @@ -536,7 +536,7 @@ GLOBAL_LIST_INIT(blacklisted_builds, list( if(!winexists(src, "asset_cache_browser")) // The client is using a custom skin, tell them. to_chat(src, span_warning("Unable to access asset cache browser, if you are using a custom skin file, please allow DS to download the updated version, if you are not, then make a bug report. This is not a critical issue but can cause issues with resource downloading, as it is impossible to know when extra resources arrived to you.")) - update_ambience_pref() + update_ambience_pref(prefs.read_preference(/datum/preference/toggle/sound_ambience)) check_ip_intel() //This is down here because of the browse() calls in tooltip/New() @@ -1128,8 +1128,8 @@ GLOBAL_LIST_INIT(blacklisted_builds, list( winset(src, "default.Shift", "is-disabled=true") winset(src, "default.ShiftUp", "is-disabled=true") -/client/proc/update_ambience_pref() - if(prefs.read_preference(/datum/preference/toggle/sound_ambience)) +/client/proc/update_ambience_pref(value) + if(value) if(SSambience.ambience_listening_clients[src] > world.time) return // If already properly set we don't want to reset the timer. SSambience.ambience_listening_clients[src] = world.time + 10 SECONDS //Just wait 10 seconds before the next one aight mate? cheers. diff --git a/code/modules/client/preferences/sounds.dm b/code/modules/client/preferences/sounds.dm index 3ace1b64326..ae3a700ec39 100644 --- a/code/modules/client/preferences/sounds.dm +++ b/code/modules/client/preferences/sounds.dm @@ -5,7 +5,7 @@ savefile_identifier = PREFERENCE_PLAYER /datum/preference/toggle/sound_ambience/apply_to_client(client/client, value) - client.update_ambience_pref() + client.update_ambience_pref(value) /// Controls hearing announcement sounds /datum/preference/toggle/sound_announcements