From e7a6101af95032c6d9d08681fc4fda8bbbb9a585 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Sun, 5 Dec 2021 16:07:43 +0100 Subject: [PATCH] [MIRROR] Make USB cables attached to locked circuits unable to be modified [MDB IGNORE] (#9882) * Make USB cables attached to locked circuits unable to be modified (#63084) Co-authored-by: Mothblocks <35135081+Mothblocks@ users.noreply.github.com> * Make USB cables attached to locked circuits unable to be modified Co-authored-by: RandomGamer123 <31096837+RandomGamer123@users.noreply.github.com> Co-authored-by: Mothblocks <35135081+Mothblocks@ users.noreply.github.com> --- code/datums/components/shell.dm | 4 ++++ code/datums/components/usb_port.dm | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/code/datums/components/shell.dm b/code/datums/components/shell.dm index ebe99cd4c2e..0e330a3547b 100644 --- a/code/datums/components/shell.dm +++ b/code/datums/components/shell.dm @@ -355,6 +355,10 @@ source.balloon_alert(user, "no circuit inside") return COMSIG_CANCEL_USB_CABLE_ATTACK + if(attached_circuit.locked) + source.balloon_alert(user, "circuit is locked!") + return COMSIG_CANCEL_USB_CABLE_ATTACK + usb_cable.attached_circuit = attached_circuit return COMSIG_USB_CABLE_CONNECTED_TO_CIRCUIT diff --git a/code/datums/components/usb_port.dm b/code/datums/components/usb_port.dm index e4022f5ff18..f4e24224268 100644 --- a/code/datums/components/usb_port.dm +++ b/code/datums/components/usb_port.dm @@ -153,6 +153,10 @@ connecting_cable.balloon_alert(user, "too far away") return COMSIG_CANCEL_USB_CABLE_ATTACK + if (connecting_cable.attached_circuit.locked) + connecting_cable.balloon_alert(user, "shell is locked!") + return COMSIG_CANCEL_USB_CABLE_ATTACK + usb_cable_ref = WEAKREF(connecting_cable) attached_circuit = connecting_cable.attached_circuit