From 145cd4c1ff6e2909b08f4ff3739cbb7f4cd75b23 Mon Sep 17 00:00:00 2001 From: Techbot121 Date: Tue, 4 Aug 2026 12:57:05 +0200 Subject: [PATCH] Fix interaction sounds not working (#6053) ## About The Pull Request the arguments for `SEND_SOUND` were switched, so even if a sound for an interaction was set it would not work. I have also changed it to use playsound instead (similarly to the existing sound emotes see [code/datums/emotes.dm:141](https://github.com/Bubberstation/Bubberstation/blob/master/code/datums/emotes.dm#L141)) that way it doesn't play at the default full volume (ouch) and would sound as you expect it. Only downside to this is that this would be audible to ghosts as well. I can just revert that change and just leave it at `SEND_SOUND(mob, sound(sound_cache, volume = 50))` if necessary. while writing this pr I was thinking, maybe I could've also set vary to true so the pitch changes as well, but I've not tested that yet and maybe it actually sounds horrible. ## Why It's Good For The Game If sounds are added to interactions, they would actually work. ## Proof Of Testing
Screenshots/Videos https://github.com/user-attachments/assets/2cc8fe04-b6b5-4f21-8cc3-bac1cf6309e0
## Changelog :cl: fix: fixed interaction sounds not working (if there was one) /:cl: --- .../modules/interaction_menu/code/interaction_datum.dm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modular_skyrat/modules/interaction_menu/code/interaction_datum.dm b/modular_skyrat/modules/interaction_menu/code/interaction_datum.dm index 0e6436bbba6..8721219599a 100644 --- a/modular_skyrat/modules/interaction_menu/code/interaction_datum.dm +++ b/modular_skyrat/modules/interaction_menu/code/interaction_datum.dm @@ -121,8 +121,9 @@ GLOBAL_LIST_EMPTY_TYPED(interaction_instances, /datum/interaction) message_admins("Deprecated sound handling for '[name]'. Correct format is a list with one entry. This message will only show once.") sound_possible = list(sound_possible) sound_cache = pick(sound_possible) - for(var/mob/mob in view(sound_range, user)) - SEND_SOUND(sound_cache, mob) + // playsound()'s range is always SOUND_RANGE (15) + extrarange, so we offset by -SOUND_RANGE to make + // extrarange effectively equal to the JSON-defined sound_range instead of stacking on top of it. + playsound(source = user, soundin = sound_cache, vol = 50, vary = FALSE, extrarange = sound_range - SOUND_RANGE, ignore_walls = FALSE, volume_preference = /datum/preference/numeric/volume/sound_emote) if(lewd) user.adjust_pleasure(user_pleasure)