AI won't resume patrolling after attacking player

So I am trying to get my AI to attack the player, once the character is dead, then patrol again and quit attacking. It seems like no matter what I do the AI keeps attacking, I’ve tried, isDead then start partrol again, isDead, isAttacking is set to false stuff like that but nothing works.

Here is some of my code attached

.

Fixed it! Had to have IsDead flag set for TPC, then on the AI_Character I cast to TPC to check if the TPC is dead then quit attacking. Fixed issue.