immediately find new target on damage

This commit is contained in:
in0finite 2021-10-16 23:54:06 +02:00
parent dad217f9b2
commit e5a97c3cb7

View file

@ -239,6 +239,7 @@ namespace SanAndreasUnity.Behaviours.Peds.AI
if (!this.IsMemberOfOurGroup(attackerPed)) if (!this.IsMemberOfOurGroup(attackerPed))
{ {
_enemyPeds.AddIfNotPresent(attackerPed); _enemyPeds.AddIfNotPresent(attackerPed);
this.UpdateState2Seconds();
return; return;
} }
@ -261,6 +262,7 @@ namespace SanAndreasUnity.Behaviours.Peds.AI
// our leader attacked someone, not as part of explosion // our leader attacked someone, not as part of explosion
// make that someone our enemy // make that someone our enemy
_enemyPeds.AddIfNotPresent(damagedPed); _enemyPeds.AddIfNotPresent(damagedPed);
this.UpdateState2Seconds();
return; return;
} }
@ -269,6 +271,7 @@ namespace SanAndreasUnity.Behaviours.Peds.AI
// our leader was attacked // our leader was attacked
// his enemies are also our enemies // his enemies are also our enemies
_enemyPeds.AddIfNotPresent(attackerPed); _enemyPeds.AddIfNotPresent(attackerPed);
this.UpdateState2Seconds();
return; return;
} }
@ -277,6 +280,7 @@ namespace SanAndreasUnity.Behaviours.Peds.AI
// attacked ped is member of our group // attacked ped is member of our group
// his enemy will be also our enemy // his enemy will be also our enemy
_enemyPeds.AddIfNotPresent(attackerPed); _enemyPeds.AddIfNotPresent(attackerPed);
this.UpdateState2Seconds();
return; return;
} }
@ -302,6 +306,7 @@ namespace SanAndreasUnity.Behaviours.Peds.AI
{ {
// either our leader or we are in the vehicle // either our leader or we are in the vehicle
_enemyPeds.AddIfNotPresent(attackerPed); _enemyPeds.AddIfNotPresent(attackerPed);
this.UpdateState2Seconds();
return; return;
} }