From 52858a68e162d8edbcfbd791a6a56dd154bb4f74 Mon Sep 17 00:00:00 2001 From: Tim Date: Thu, 11 Jun 2026 17:54:55 -0500 Subject: [PATCH] Add sound to light switches (#96432) ## About The Pull Request This adds the flashlight toggle on/off sound to the room light switches. This is also used by a lot of other lighting objects, like lamps and lanterns. ## Why It's Good For The Game Mah Immersion! ## Changelog :cl: sound: Add on/off sound to light switches in rooms /:cl: --- code/game/machinery/lightswitch.dm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/code/game/machinery/lightswitch.dm b/code/game/machinery/lightswitch.dm index 7d553e47b2d..4091e012985 100644 --- a/code/game/machinery/lightswitch.dm +++ b/code/game/machinery/lightswitch.dm @@ -15,6 +15,10 @@ var/light_on_range = 1 /// Should this lightswitch automatically rename itself to match the area it's in? var/autoname = TRUE + /// The sound the light makes when it's turned on + var/sound_on = 'sound/items/weapons/magin.ogg' + /// The sound the light makes when it's turned off + var/sound_off = 'sound/items/weapons/magout.ogg' MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/light_switch, 26) @@ -73,6 +77,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/light_switch, 26) /obj/machinery/light_switch/interact(mob/user) . = ..() + playsound(src, area.lightswitch ? sound_off : sound_on, 40, TRUE) set_lights(!area.lightswitch) /obj/machinery/light_switch/screwdriver_act(mob/living/user, obj/item/tool)