mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-26 05:50:18 +00:00
make enemies of peds which are attacked by our leader
This commit is contained in:
parent
3d2ff03357
commit
36d3cfcd7e
1 changed files with 11 additions and 0 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue