From 439a04ef97e671ea86ebba01aa2874bb65aed198 Mon Sep 17 00:00:00 2001 From: oranges Date: Fri, 17 Feb 2023 12:44:02 +1300 Subject: [PATCH] Made prox sensor cooldown apply before pulse effect (#73447) This prevents it pulsing multiple times before the next activation time is reached --------- Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com> --- code/modules/assembly/proximity.dm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/modules/assembly/proximity.dm b/code/modules/assembly/proximity.dm index 56fdc8629bf..00b1939a52d 100644 --- a/code/modules/assembly/proximity.dm +++ b/code/modules/assembly/proximity.dm @@ -90,11 +90,12 @@ /obj/item/assembly/prox_sensor/proc/sense() if(!scanning || !secured || next_activate > world.time) return FALSE + next_activate = world.time + (3 SECONDS) // this must happen before anything else pulse() audible_message("[icon2html(src, hearers(src))] *beep* *beep* *beep*", null, hearing_range) for(var/mob/hearing_mob in get_hearers_in_view(hearing_range, src)) hearing_mob.playsound_local(get_turf(src), 'sound/machines/triple_beep.ogg', ASSEMBLY_BEEP_VOLUME, TRUE) - next_activate = world.time + 30 + return TRUE /obj/item/assembly/prox_sensor/process(delta_time)