makes SOUND_MUTE actually FUCKING WORK when deaf. thanks azarak for helping with debugging!

This commit is contained in:
deathride58
2022-05-21 20:48:37 -04:00
parent 5d648fcf6a
commit 087602711f
2 changed files with 5 additions and 6 deletions
+1 -5
View File
@@ -120,10 +120,6 @@ SUBSYSTEM_DEF(jukeboxes)
var/mixes = ((targetfalloff*250)-750)
var/inrange
//Workaround for a BYOND bug. (SOUND_MUTE | SOUND_UPDATE) no longer works. at all. it doesn't mute the sound, and it doesn't allow the sound to update. We have no idea when this broke.
//"What happens if you just set the volume to 0?" this never worked. When a sound's sent with a volume of 0, dreamseeker simply does nothing.
//So instead, we're gonna mute the dry and wet channels while still keeping the sound exactly the same. TECHNICALLY this works. Buuuut technically the sound's still audible.
for(var/mob/M in GLOB.player_list)
if(!M.client)
continue
@@ -140,7 +136,7 @@ SUBSYSTEM_DEF(jukeboxes)
song_played.status = SOUND_UPDATE
else
song_played.status = SOUND_MUTE | SOUND_UPDATE
song_played.falloff = (inrange ? targetfalloff : targetfalloff * targetfalloff) //The wet channel uses a sqrt falloff by default. Exponentially increasing the falloff when muffled makes
song_played.falloff = (inrange ? targetfalloff : targetfalloff * targetfalloff) //The wet channel uses a sqrt falloff by default. Exponentially increasing the falloff when muffled cancels out that sqrt falloff
M.playsound_local(currentturf, null, (targetfalloff ? min((targetfalloff * 50), 100) : 1), channel = jukeinfo[JUKE_CHANNEL], S = song_played, envwet = ((inrange) ? mixes : max(mixes, 0)), envdry = (inrange ? max(mixes, 0) : -10000))
CHECK_TICK
return
+4 -1
View File
@@ -111,12 +111,15 @@ distance_multiplier - Can be used to multiply the distance at which the sound is
/mob/proc/playsound_local(turf/turf_source, soundin, vol as num, vary, frequency, falloff_exponent = SOUND_FALLOFF_EXPONENT, channel = 0, pressure_affected = TRUE, sound/S, max_distance,
falloff_distance = SOUND_DEFAULT_FALLOFF_DISTANCE, distance_multiplier = SOUND_DEFAULT_DISTANCE_MULTIPLIER, envwet = -10000, envdry = 0)
if(!client || !can_hear())
if(!client)
return
if(!S)
S = sound(get_sfx(soundin))
if(!can_hear() && !(S.status & SOUND_UPDATE)) //This is primarily to make sure sound updates still go through when a spaceman's deaf
return
S.wait = 0 //No queue
S.channel = channel || SSsounds.random_available_channel()
S.volume = vol