From 6eb22e1ff1ecdf2e7fb71956be9270dba0cc7998 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Thu, 3 Feb 2022 21:41:27 +0100 Subject: [PATCH] [MIRROR] fixes not being able to resist out of aggro grabs [MDB IGNORE] (#11262) * fixes not being able to resist out of aggro grabs (#64642) * fixes not being able to resist out of aggro grabs Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com> --- code/modules/mob/living/living.dm | 20 ++++++++++++-------- code/modules/mob/mob_movement.dm | 2 +- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 42c75a0767c..1fe13e2e038 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -465,28 +465,28 @@ death() /** - * Checks if a mob is incapacitated + * Checks if a mob is incapacitated * * Normally being restrained, agressively grabbed, or in stasis counts as incapacitated * unless there is a flag being used to check if it's ignored - * + * * args: * * flags (optional) bitflags that determine if special situations are exempt from being considered incapacitated - * + * * bitflags: (see code/__DEFINES/status_effects.dm) * * IGNORE_RESTRAINTS - mob in a restraint (handcuffs) is not considered incapacitated * * IGNORE_STASIS - mob in stasis (stasis bed, etc.) is not considered incapacitated - * * IGNORE_GRAB - mob that is agressively grabbed is not considered incapacitated + * * IGNORE_GRAB - mob that is agressively grabbed is not considered incapacitated **/ /mob/living/incapacitated(flags) if(HAS_TRAIT(src, TRAIT_INCAPACITATED)) return TRUE - if(HAS_TRAIT(src, TRAIT_RESTRAINED) && !(flags & IGNORE_RESTRAINTS)) + if(!(flags & IGNORE_RESTRAINTS) && HAS_TRAIT(src, TRAIT_RESTRAINED)) return TRUE - if(IS_IN_STASIS(src) && !(flags & IGNORE_STASIS)) + if(!(flags & IGNORE_GRAB) && pulledby && pulledby.grab_state >= GRAB_AGGRESSIVE) return TRUE - if((pulledby && pulledby.grab_state >= GRAB_AGGRESSIVE) && !(flags & IGNORE_GRAB)) + if(!(flags & IGNORE_STASIS) && IS_IN_STASIS(src)) return TRUE return FALSE @@ -988,7 +988,11 @@ ..(pressure_difference, direction, pressure_resistance_prob_delta) /mob/living/can_resist() - return !((next_move > world.time) || incapacitated(IGNORE_RESTRAINTS|IGNORE_STASIS)) + if(next_move > world.time) + return FALSE + if(HAS_TRAIT(src, TRAIT_INCAPACITATED)) + return FALSE + return TRUE /mob/living/verb/resist() set name = "Resist" diff --git a/code/modules/mob/mob_movement.dm b/code/modules/mob/mob_movement.dm index 21e7c287257..b192b776528 100644 --- a/code/modules/mob/mob_movement.dm +++ b/code/modules/mob/mob_movement.dm @@ -184,7 +184,7 @@ return FALSE if(mob.pulledby == mob.pulling && mob.pulledby.grab_state == GRAB_PASSIVE) //Don't autoresist passive grabs if we're grabbing them too. return FALSE - if(mob.incapacitated(IGNORE_RESTRAINTS)) + if(HAS_TRAIT(mob, TRAIT_INCAPACITATED)) COOLDOWN_START(src, move_delay, 1 SECONDS) return TRUE else if(HAS_TRAIT(mob, TRAIT_RESTRAINED))