diff --git a/code/__DEFINES/cooldowns.dm b/code/__DEFINES/cooldowns.dm index fe72b872053..6bca58aac18 100644 --- a/code/__DEFINES/cooldowns.dm +++ b/code/__DEFINES/cooldowns.dm @@ -42,8 +42,10 @@ //clown car cooldowns #define COOLDOWN_CLOWNCAR_RANDOMNESS "clown_car_randomness" -//circuit cooldowns +// item cooldowns +#define COOLDOWN_SIGNALLER_SEND "cooldown_signaller_send" +//circuit cooldowns #define COOLDOWN_CIRCUIT_SOUNDEMITTER "circuit_soundemitter" #define COOLDOWN_CIRCUIT_SPEECH "circuit_speech" #define COOLDOWN_CIRCUIT_PATHFIND_SAME "circuit_pathfind_same" diff --git a/code/game/communications.dm b/code/game/communications.dm index 3c52c5b2eaa..99cfcc39663 100644 --- a/code/game/communications.dm +++ b/code/game/communications.dm @@ -180,6 +180,7 @@ GLOBAL_LIST_INIT(reverseradiochannels, list( if(start_point.z != end_point.z || (range > 0 && get_dist(start_point, end_point) > range)) continue device.receive_signal(signal) + CHECK_TICK /datum/radio_frequency/proc/add_listener(obj/device, filter as text|null) if (!filter) diff --git a/code/modules/assembly/signaler.dm b/code/modules/assembly/signaler.dm index d6fa2c82dbe..157be028163 100644 --- a/code/modules/assembly/signaler.dm +++ b/code/modules/assembly/signaler.dm @@ -91,6 +91,10 @@ switch(action) if("signal") + if(TIMER_COOLDOWN_CHECK(src, COOLDOWN_SIGNALLER_SEND)) + to_chat(usr, span_warning("[src] is still recharging...")) + return + TIMER_COOLDOWN_START(src, COOLDOWN_SIGNALLER_SEND, 1 SECONDS) INVOKE_ASYNC(src, .proc/signal) . = TRUE if("freq") diff --git a/code/modules/wiremod/components/action/radio.dm b/code/modules/wiremod/components/action/radio.dm index 540b79f7cf5..109a7428f44 100644 --- a/code/modules/wiremod/components/action/radio.dm +++ b/code/modules/wiremod/components/action/radio.dm @@ -34,7 +34,7 @@ . = ..() freq = add_input_port("Frequency", PORT_TYPE_NUMBER, default = FREQ_SIGNALER) code = add_input_port("Code", PORT_TYPE_NUMBER, default = DEFAULT_SIGNALER_CODE) - TRIGGER_CIRCUIT_COMPONENT(src, null) + INVOKE_ASYNC(src, .proc/apply_signal_component) // These are cleaned up on the parent trigger_input = add_input_port("Send", PORT_TYPE_SIGNAL) trigger_output = add_output_port("Received", PORT_TYPE_SIGNAL) @@ -43,6 +43,9 @@ SSradio.remove_object(src, current_freq) return ..() +/obj/item/circuit_component/radio/proc/apply_signal_component() + TRIGGER_CIRCUIT_COMPONENT(src, null) + /obj/item/circuit_component/radio/input_received(datum/port/input/port) . = ..() freq.set_value(sanitize_frequency(freq.value, TRUE))