[MIRROR] Fixes right click on circuit controller (#7584)

* Fixes right click on circuit controller (#60840)

Co-authored-by: Colovorat <lolqwert569@ gmail.com>

* Fixes right click on circuit controller

Co-authored-by: Colovorat <35225170+Colovorat@users.noreply.github.com>
Co-authored-by: Colovorat <lolqwert569@ gmail.com>
This commit is contained in:
SkyratBot
2021-08-16 00:53:21 +02:00
committed by GitHub
parent 7a9c41db9a
commit 8794b3bcff
+6 -3
View File
@@ -43,17 +43,17 @@
/obj/item/circuit_component/controller/register_shell(atom/movable/shell)
RegisterSignal(shell, COMSIG_ITEM_ATTACK_SELF, .proc/send_trigger)
RegisterSignal(shell, COMSIG_CLICK_ALT, .proc/send_alternate_signal)
RegisterSignal(shell, COMSIG_ATOM_ATTACK_HAND_SECONDARY, .proc/send_right_signal)
RegisterSignal(shell, COMSIG_ITEM_ATTACK_SELF_SECONDARY, .proc/send_right_signal)
/obj/item/circuit_component/controller/unregister_shell(atom/movable/shell)
UnregisterSignal(shell, list(
COMSIG_ITEM_ATTACK_SELF,
COMSIG_ATOM_ATTACK_HAND_SECONDARY,
COMSIG_ITEM_ATTACK_SELF_SECONDARY,
COMSIG_CLICK_ALT,
))
/**
* Called when the shell item is used in hand, including right click.
* Called when the shell item is used in hand
*/
/obj/item/circuit_component/controller/proc/send_trigger(atom/source, mob/user)
SIGNAL_HANDLER
@@ -76,6 +76,9 @@
entity.set_output(user)
alt.set_output(COMPONENT_SIGNAL)
/**
* Called when the shell item is right-clicked in active hand
*/
/obj/item/circuit_component/controller/proc/send_right_signal(atom/source, mob/user)
SIGNAL_HANDLER
if(!user.Adjacent(source))