Prevents sec bots from cuffing when turned off (#20951)

* prevents sec bot cuffing while off

By adding a check for if a sec bot is on when actually applying cuffs, sec bots can be stopped mid cuff by turning them off

* makes src implicit

Co-authored-by: Contrabang <91113370+Contrabang@users.noreply.github.com>

---------

Co-authored-by: Contrabang <91113370+Contrabang@users.noreply.github.com>
This commit is contained in:
Taran
2023-04-28 02:52:05 -06:00
committed by GitHub
parent 36ce74ed7f
commit e1effdfb7a
@@ -247,7 +247,7 @@
/mob/living/simple_animal/bot/secbot/proc/cuff_callback(mob/living/carbon/C)
if(do_after(src, 60, target = C))
if(!C.handcuffed)
if(!C.handcuffed && on)
C.handcuffed = new /obj/item/restraints/handcuffs/cable/zipties/used(C)
C.update_handcuffed()
playsound(loc, pick('sound/voice/bgod.ogg', 'sound/voice/biamthelaw.ogg', 'sound/voice/bsecureday.ogg', 'sound/voice/bradio.ogg', 'sound/voice/binsult.ogg', 'sound/voice/bcreep.ogg'), 50, 0)