From e5813bec20248cd8a20470898b78c5450456a604 Mon Sep 17 00:00:00 2001 From: Darius <5933805+LeDrascol@users.noreply.github.com> Date: Tue, 3 Jan 2023 14:36:56 -0500 Subject: [PATCH] Play BSLR effects only when replacing Prevents the Bluespace Light Replacer from playing sounds or displaying a beam when the target's light won't be replaced. Based on the BSRPED's behavior. --- code/game/objects/items/devices/lightreplacer.dm | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/code/game/objects/items/devices/lightreplacer.dm b/code/game/objects/items/devices/lightreplacer.dm index 97c61caffd..c5e92349c7 100644 --- a/code/game/objects/items/devices/lightreplacer.dm +++ b/code/game/objects/items/devices/lightreplacer.dm @@ -257,8 +257,17 @@ used = TRUE if(istype(A, /obj/machinery/light)) if(!proximity && bluespace_toggle) - U.Beam(A, icon_state = "rped_upgrade", time = 1 SECONDS) - playsound(src, 'sound/items/pshoom.ogg', 40, 1) + // Set variable for target light + var/obj/machinery/light/target = A + + // Check light status before playing effects + if(target.status != LIGHT_OK) + // Display RPED beam + U.Beam(A, icon_state = "rped_upgrade", time = 1 SECONDS) + + // Play RPED sound + playsound(src, 'sound/items/pshoom.ogg', 40, 1) + ReplaceLight(A, U) if(!used)