fixes ai controllers resetting their targets post do_afters (#87426)

## About The Pull Request
mobs would disregard you for a bit if they went through a do_after, such
as goldgrub digging or medbots healing. this fixes that

## Why It's Good For The Game
fixes ai controllers resetting their targets post do_afters

## Changelog
🆑
fix: fixes ai controllers resetting their targets post do_afters
/🆑
This commit is contained in:
Ben10Omintrix
2024-10-25 02:49:00 +03:00
committed by GitHub
parent de0b5abd82
commit f698cea0f4
7 changed files with 28 additions and 18 deletions
@@ -30,17 +30,17 @@
/datum/ai_controller/basic_controller/get_able_to_run()
. = ..()
if(!.)
return FALSE
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 FALSE
else if(IS_DEAD_OR_INCAP(living_pawn))
return FALSE
return AI_UNABLE_TO_RUN
if(IS_DEAD_OR_INCAP(living_pawn))
return AI_UNABLE_TO_RUN
if(ai_traits & PAUSE_DURING_DO_AFTER && LAZYLEN(living_pawn.do_afters))
return FALSE
return AI_UNABLE_TO_RUN | AI_PREVENT_CANCEL_ACTIONS //dont erase targets post a do_after
/datum/ai_controller/basic_controller/proc/update_speed(mob/living/basic/basic_mob)
SIGNAL_HANDLER