From bb8874d6d70cb2c1787455d0efeabe92115f740d Mon Sep 17 00:00:00 2001 From: MrMelbert Date: Wed, 28 Feb 2024 01:44:04 -0600 Subject: [PATCH 1/2] Gunpoint blocks headset usage --- code/datums/components/gunpoint.dm | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/code/datums/components/gunpoint.dm b/code/datums/components/gunpoint.dm index ed4142f41ceb..b055499bca00 100644 --- a/code/datums/components/gunpoint.dm +++ b/code/datums/components/gunpoint.dm @@ -43,6 +43,7 @@ COMSIG_MOB_FIRED_GUN, COMSIG_MOVABLE_SET_GRAB_STATE, COMSIG_LIVING_START_PULL), PROC_REF(trigger_reaction)) + RegisterSignal(targ, COMSIG_MOVABLE_USING_RADIO, PROC_REF(radio_trigger_reaction)) RegisterSignal(targ, COMSIG_ATOM_EXAMINE, PROC_REF(examine_target)) RegisterSignal(targ, COMSIG_LIVING_PRE_MOB_BUMP, PROC_REF(block_bumps_target)) RegisterSignals(targ, list(COMSIG_LIVING_DISARM_HIT, COMSIG_LIVING_GET_PULLED), PROC_REF(cancel)) @@ -151,6 +152,14 @@ SIGNAL_HANDLER INVOKE_ASYNC(src, PROC_REF(async_trigger_reaction)) +/datum/component/gunpoint/proc/radio_trigger_reaction(datum/source, obj/item/radio) + SIGNAL_HANDLER + if(radio.loc != source) + return NONE + INVOKE_ASYNC(src, PROC_REF(async_trigger_reaction)) + to_chat(source, span_warning("You fail to reach [radio]!")) + return COMPONENT_CANNOT_USE_RADIO + /datum/component/gunpoint/proc/async_trigger_reaction() var/mob/living/shooter = parent shooter.remove_status_effect(/datum/status_effect/holdup) // try doing these before the trigger gets pulled since the target (or shooter even) may not exist after pulling the trigger, dig? From 5722c97912b30caea3319396ea85157f2e806db1 Mon Sep 17 00:00:00 2001 From: MrMelbert Date: Wed, 28 Feb 2024 01:47:15 -0600 Subject: [PATCH 2/2] For posterity --- code/datums/components/gunpoint.dm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/datums/components/gunpoint.dm b/code/datums/components/gunpoint.dm index b055499bca00..5716ddf589c3 100644 --- a/code/datums/components/gunpoint.dm +++ b/code/datums/components/gunpoint.dm @@ -43,7 +43,7 @@ COMSIG_MOB_FIRED_GUN, COMSIG_MOVABLE_SET_GRAB_STATE, COMSIG_LIVING_START_PULL), PROC_REF(trigger_reaction)) - RegisterSignal(targ, COMSIG_MOVABLE_USING_RADIO, PROC_REF(radio_trigger_reaction)) + RegisterSignal(targ, COMSIG_MOVABLE_USING_RADIO, PROC_REF(radio_trigger_reaction)) // NON-MODULE CHANGE RegisterSignal(targ, COMSIG_ATOM_EXAMINE, PROC_REF(examine_target)) RegisterSignal(targ, COMSIG_LIVING_PRE_MOB_BUMP, PROC_REF(block_bumps_target)) RegisterSignals(targ, list(COMSIG_LIVING_DISARM_HIT, COMSIG_LIVING_GET_PULLED), PROC_REF(cancel)) @@ -152,6 +152,7 @@ SIGNAL_HANDLER INVOKE_ASYNC(src, PROC_REF(async_trigger_reaction)) +// NON-MODULE CHANGE /datum/component/gunpoint/proc/radio_trigger_reaction(datum/source, obj/item/radio) SIGNAL_HANDLER if(radio.loc != source) @@ -159,6 +160,7 @@ INVOKE_ASYNC(src, PROC_REF(async_trigger_reaction)) to_chat(source, span_warning("You fail to reach [radio]!")) return COMPONENT_CANNOT_USE_RADIO +// NON-MODULE CHANGE END /datum/component/gunpoint/proc/async_trigger_reaction() var/mob/living/shooter = parent