From 2c7c76a53dd013b0eda27c2bd3368cdcb9a1b78b Mon Sep 17 00:00:00 2001 From: SmArtKar <44720187+SmArtKar@users.noreply.github.com> Date: Fri, 4 Oct 2024 01:30:59 +0200 Subject: [PATCH] Fixes BCI messaging and circuit laser pointers (#86978) ## About The Pull Request Closes #86968 Closes #86969 ## Changelog :cl: fix: Fixed BCIs sending messages twice and circuit laser pointers sometimes failing to work /:cl: --- code/modules/wiremod/components/action/laserpointer.dm | 5 ++--- code/modules/wiremod/shell/brain_computer_interface.dm | 3 +++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/code/modules/wiremod/components/action/laserpointer.dm b/code/modules/wiremod/components/action/laserpointer.dm index eb1324280cf..0eb7f822db1 100644 --- a/code/modules/wiremod/components/action/laserpointer.dm +++ b/code/modules/wiremod/components/action/laserpointer.dm @@ -59,10 +59,9 @@ silicon.flash_act(affect_silicon = TRUE) /// no stunning, just a blind to_chat(silicon, span_danger("Your sensors were overloaded by a weakened laser shone by [shell]!")) - var/image/laser_location = image('icons/obj/weapons/guns/projectiles.dmi',target_location,"[pointer_icon_state]_laser",10) + var/mutable_appearance/laser_location = mutable_appearance('icons/obj/weapons/guns/projectiles.dmi', "[pointer_icon_state]_laser") laser_location.pixel_x = clamp(target.pixel_x + image_pixel_x.value,-15,15) laser_location.pixel_y = clamp(target.pixel_y + image_pixel_y.value,-15,15) - target_location.add_overlay(laser_location) - addtimer(CALLBACK(target_location, TYPE_PROC_REF(/atom, cut_overlay), laser_location), 1 SECONDS) + target_location.flick_overlay_view(laser_location, 1 SECONDS) diff --git a/code/modules/wiremod/shell/brain_computer_interface.dm b/code/modules/wiremod/shell/brain_computer_interface.dm index 7e9f79a58f6..e3ddf54135a 100644 --- a/code/modules/wiremod/shell/brain_computer_interface.dm +++ b/code/modules/wiremod/shell/brain_computer_interface.dm @@ -151,6 +151,9 @@ )) /obj/item/circuit_component/bci_core/input_received(datum/port/input/port) + if (!COMPONENT_TRIGGERED_BY(send_message_signal, port)) + return + var/sent_message = trim(message.value) if (!sent_message) return