diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm
index 443e28ab26..404ca1df8d 100644
--- a/code/modules/mob/living/carbon/carbon.dm
+++ b/code/modules/mob/living/carbon/carbon.dm
@@ -305,15 +305,15 @@
to_chat(src, "You're already attempting to remove [I]!")
return
var/obj/item/restraints/R = istype(I, /obj/item/restraints) ? I : null
- var/allow_breakout_movement = NONE
+ var/allow_breakout_movement = IGNORE_INCAPACITATED
if(R?.allow_breakout_movement)
- allow_breakout_movement = (IGNORE_USER_LOC_CHANGE|IGNORE_TARGET_LOC_CHANGE)
+ allow_breakout_movement = (IGNORE_INCAPACITATED|IGNORE_USER_LOC_CHANGE|IGNORE_TARGET_LOC_CHANGE)
I.item_flags |= BEING_REMOVED
breakouttime = I.breakouttime
if(!cuff_break)
visible_message("[src] attempts to remove [I]!")
to_chat(src, "You attempt to remove [I]... (This will take around [DisplayTimeText(breakouttime)] and you need to stand still.)")
- if(do_after(src, breakouttime, target = src, timed_action_flags = allow_breakout_movement))
+ if(do_after(src, breakouttime, target = src, timed_action_flags = allow_breakout_movement, extra_checks = CALLBACK(src, PROC_REF(cuff_resist_check))))
clear_cuffs(I, cuff_break)
else
to_chat(src, "You fail to remove [I]!")
@@ -322,7 +322,7 @@
breakouttime = 50
visible_message("[src] is trying to break [I]!")
to_chat(src, "You attempt to break [I]... (This will take around 5 seconds and you need to stand still.)")
- if(do_after(src, breakouttime, target = src, timed_action_flags = allow_breakout_movement))
+ if(do_after(src, breakouttime, target = src, timed_action_flags = allow_breakout_movement, extra_checks = CALLBACK(src, PROC_REF(cuff_resist_check))))
clear_cuffs(I, cuff_break)
else
to_chat(src, "You fail to break [I]!")
@@ -332,6 +332,9 @@
I.item_flags &= ~BEING_REMOVED
+/mob/living/carbon/proc/cuff_resist_check()
+ return !incapacitated(ignore_restraints = TRUE)
+
/mob/living/carbon/proc/uncuff()
if (handcuffed)
var/obj/item/W = handcuffed
diff --git a/code/modules/mob/living/carbon/human/human_mobility.dm b/code/modules/mob/living/carbon/human/human_mobility.dm
index 99577f4b05..1e69dc00f3 100644
--- a/code/modules/mob/living/carbon/human/human_mobility.dm
+++ b/code/modules/mob/living/carbon/human/human_mobility.dm
@@ -35,7 +35,7 @@
standupwarning = "[src] struggles to stand up."
var/usernotice = automatic ? "You are now getting up. (Auto)" : "You are now getting up."
visible_message("[standupwarning]", usernotice, vision_distance = 5)
- if(do_after(src, totaldelay, target = src, timed_action_flags = (IGNORE_USER_LOC_CHANGE|IGNORE_TARGET_LOC_CHANGE|IGNORE_HELD_ITEM)))
+ if(do_after(src, totaldelay, target = src, timed_action_flags = (IGNORE_USER_LOC_CHANGE|IGNORE_TARGET_LOC_CHANGE|IGNORE_HELD_ITEM|IGNORE_INCAPACITATED), extra_checks = CALLBACK(src, PROC_REF(cuff_resist_check))))
set_resting(FALSE, TRUE)
combat_flags &= ~COMBAT_FLAG_RESISTING_REST