make enemies of peds which are attacked by our leader

This commit is contained in:
in0finite 2021-09-13 01:51:36 +02:00
parent 3d2ff03357
commit 36d3cfcd7e

View file

@ -140,6 +140,17 @@ namespace SanAndreasUnity.Behaviours
if (this.Action == PedAIAction.Following)
{
if (null == this.TargetPed) // we are not in a group
return;
if (attackerPed == this.TargetPed && !this.IsMemberOfOurGroup(otherPed) && dmgInfo.damageType != DamageType.Explosion)
{
// our leader attacked someone, not as part of explosion
// make that someone our enemy
_enemyPeds.AddIfNotPresent(otherPed);
return;
}
if (this.IsMemberOfOurGroup(attackerPed))
return;