From e5a97c3cb745bfaa8aa044554f249259244e9c4f Mon Sep 17 00:00:00 2001 From: in0finite Date: Sat, 16 Oct 2021 23:54:06 +0200 Subject: [PATCH] immediately find new target on damage --- Assets/Scripts/Behaviours/PedAI/FollowState.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Assets/Scripts/Behaviours/PedAI/FollowState.cs b/Assets/Scripts/Behaviours/PedAI/FollowState.cs index b68afc48..84b48d95 100644 --- a/Assets/Scripts/Behaviours/PedAI/FollowState.cs +++ b/Assets/Scripts/Behaviours/PedAI/FollowState.cs @@ -239,6 +239,7 @@ namespace SanAndreasUnity.Behaviours.Peds.AI if (!this.IsMemberOfOurGroup(attackerPed)) { _enemyPeds.AddIfNotPresent(attackerPed); + this.UpdateState2Seconds(); return; } @@ -261,6 +262,7 @@ namespace SanAndreasUnity.Behaviours.Peds.AI // our leader attacked someone, not as part of explosion // make that someone our enemy _enemyPeds.AddIfNotPresent(damagedPed); + this.UpdateState2Seconds(); return; } @@ -269,6 +271,7 @@ namespace SanAndreasUnity.Behaviours.Peds.AI // our leader was attacked // his enemies are also our enemies _enemyPeds.AddIfNotPresent(attackerPed); + this.UpdateState2Seconds(); return; } @@ -277,6 +280,7 @@ namespace SanAndreasUnity.Behaviours.Peds.AI // attacked ped is member of our group // his enemy will be also our enemy _enemyPeds.AddIfNotPresent(attackerPed); + this.UpdateState2Seconds(); return; } @@ -302,6 +306,7 @@ namespace SanAndreasUnity.Behaviours.Peds.AI { // either our leader or we are in the vehicle _enemyPeds.AddIfNotPresent(attackerPed); + this.UpdateState2Seconds(); return; }