From 29b20ec201dfa5a0270dbb136b518ff6b0dbe1c3 Mon Sep 17 00:00:00 2001 From: joep van der velden Date: Sat, 16 Feb 2019 12:34:13 +0100 Subject: [PATCH 1/2] Beepsky now uses do after --- code/modules/mob/living/simple_animal/bot/secbot.dm | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/code/modules/mob/living/simple_animal/bot/secbot.dm b/code/modules/mob/living/simple_animal/bot/secbot.dm index 84ab158504d..93df98f4efa 100644 --- a/code/modules/mob/living/simple_animal/bot/secbot.dm +++ b/code/modules/mob/living/simple_animal/bot/secbot.dm @@ -231,9 +231,7 @@ Auto Patrol: []"}, playsound(loc, 'sound/weapons/cablecuff.ogg', 30, 1, -2) C.visible_message("[src] is trying to put zipties on [C]!",\ "[src] is trying to put zipties on you!") - spawn(60) - if( !Adjacent(C) || !isturf(C.loc) ) //if he's in a closet or not adjacent, we cancel cuffing. - return + if(do_after(src, 60, target = C)) if(!C.handcuffed) C.handcuffed = new /obj/item/restraints/handcuffs/cable/zipties/used(C) C.update_handcuffed() From e44cab464d591a9642ee4dd135cda71ae48e3a31 Mon Sep 17 00:00:00 2001 From: joep van der velden Date: Mon, 18 Feb 2019 21:12:14 +0100 Subject: [PATCH 2/2] invoke_async then --- code/modules/mob/living/simple_animal/bot/secbot.dm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/code/modules/mob/living/simple_animal/bot/secbot.dm b/code/modules/mob/living/simple_animal/bot/secbot.dm index 93df98f4efa..186a0c7747d 100644 --- a/code/modules/mob/living/simple_animal/bot/secbot.dm +++ b/code/modules/mob/living/simple_animal/bot/secbot.dm @@ -231,6 +231,9 @@ Auto Patrol: []"}, playsound(loc, 'sound/weapons/cablecuff.ogg', 30, 1, -2) C.visible_message("[src] is trying to put zipties on [C]!",\ "[src] is trying to put zipties on you!") + INVOKE_ASYNC(src, .proc/cuff_callback, C) + +/mob/living/simple_animal/bot/secbot/proc/cuff_callback(mob/living/carbon/C) if(do_after(src, 60, target = C)) if(!C.handcuffed) C.handcuffed = new /obj/item/restraints/handcuffs/cable/zipties/used(C)