Most hostile mobs can no longer be trapped by closets, chairs, and aggro grabs (#91652)

This commit is contained in:
Jacquerel
2025-06-21 02:21:22 +01:00
committed by GitHub
parent 897909e7d0
commit e3dee6810e
114 changed files with 262 additions and 296 deletions
@@ -33,12 +33,18 @@
if(. & AI_UNABLE_TO_RUN)
return .
var/mob/living/living_pawn = pawn
if(!(ai_traits & CAN_ACT_WHILE_DEAD))
// Unroll for flags here
if((ai_traits & CAN_ACT_IN_STASIS) && (living_pawn.stat || INCAPACITATED_IGNORING(living_pawn, INCAPABLE_STASIS)))
return AI_UNABLE_TO_RUN
if(IS_DEAD_OR_INCAP(living_pawn))
return AI_UNABLE_TO_RUN
if (living_pawn.stat && !(ai_traits & CAN_ACT_WHILE_DEAD))
return AI_UNABLE_TO_RUN
var/ignore_incap_flags = NONE
if((ai_traits & CAN_ACT_IN_STASIS))
ignore_incap_flags |= INCAPABLE_STASIS
if((ai_traits & CAN_ACT_WHILE_GRABBED))
ignore_incap_flags |= INCAPABLE_GRAB
if(INCAPACITATED_IGNORING(living_pawn, ignore_incap_flags))
return AI_UNABLE_TO_RUN
if(ai_traits & PAUSE_DURING_DO_AFTER && LAZYLEN(living_pawn.do_afters))
return AI_UNABLE_TO_RUN | AI_PREVENT_CANCEL_ACTIONS //dont erase targets post a do_after