From ee31e907cbcb9018a85f4b27d759cccbf4f30649 Mon Sep 17 00:00:00 2001 From: CliffracerX Date: Sat, 19 Oct 2024 14:28:44 -0400 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Tom <8881105+tf-4@users.noreply.github.com> Signed-off-by: CliffracerX --- modular_doppler/_HELPERS/preferences.dm | 2 +- modular_doppler/dopplerboop/dopplerboops.dm | 2 +- .../preferences/middleware/dopplerboops.dm | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modular_doppler/_HELPERS/preferences.dm b/modular_doppler/_HELPERS/preferences.dm index b46598abbb803..c5def100ad057 100644 --- a/modular_doppler/_HELPERS/preferences.dm +++ b/modular_doppler/_HELPERS/preferences.dm @@ -12,5 +12,5 @@ GLOBAL_LIST_INIT(dopplerboop_voice_types, sort_list(list( "jock", "lazy", "smug", - "mute" + "mute", ))) diff --git a/modular_doppler/dopplerboop/dopplerboops.dm b/modular_doppler/dopplerboop/dopplerboops.dm index 4436bb1288a2c..53393fe46d82f 100644 --- a/modular_doppler/dopplerboop/dopplerboops.dm +++ b/modular_doppler/dopplerboop/dopplerboops.dm @@ -99,6 +99,6 @@ if(!volume || (last_dopplerboop != initial_dopplerboop_time) || !final_boop) return for(var/mob/hearer as anything in hearers) - var/user_volume = hearer.client.prefs.read_preference(/datum/preference/numeric/voice_volume) + var/user_volume = hearer.client?.prefs.read_preference(/datum/preference/numeric/voice_volume) volume = volume*(user_volume / 10) hearer.playsound_local(turf_source = get_turf(dopplerbooper), sound_to_use = final_boop, vol = volume, vary = TRUE, frequency = freq, falloff_distance = falloff_exponent, max_distance = 16) diff --git a/modular_doppler/modular_customization/preferences/middleware/dopplerboops.dm b/modular_doppler/modular_customization/preferences/middleware/dopplerboops.dm index dd515ec596631..f0ae2747c3a1b 100644 --- a/modular_doppler/modular_customization/preferences/middleware/dopplerboops.dm +++ b/modular_doppler/modular_customization/preferences/middleware/dopplerboops.dm @@ -13,7 +13,7 @@ var/boop_letter = null var/dopplerboop_delay_cumulative = 0 var/sound/final_boop = null - var/user_volume = user.client.prefs.read_preference(/datum/preference/numeric/voice_volume) + var/user_volume = user.client?.prefs.read_preference(/datum/preference/numeric/voice_volume) for(var/i in 1 to min(length(all_boops), MAX_DOPPLERBOOP_CHARACTERS)) var/volume = DOPPLERBOOP_DEFAULT_VOLUME