fix some errors

This commit is contained in:
in0finite 2021-09-26 19:50:09 +02:00
parent 14236b8342
commit 7ddb5d0556
2 changed files with 2 additions and 7 deletions

View file

@ -203,14 +203,14 @@ namespace SanAndreasUnity.Behaviours.Peds.AI
bool IsMemberOfOurGroup(Ped ped)
{
if (this.Action != PedAIAction.Following || this.TargetPed == null) // we are not part of any group
if (this.TargetPed == null) // we are not part of any group
return false;
if (this.TargetPed == ped) // our leader
return true;
var pedAI = ped.GetComponent<PedAI>();
if (pedAI != null && pedAI.Action == PedAIAction.Following && pedAI.TargetPed == this.TargetPed)
if (pedAI != null && pedAI.CurrentState is FollowState followState && followState.TargetPed == this.TargetPed)
return true;
return false;

View file

@ -30,11 +30,6 @@ namespace SanAndreasUnity.Behaviours.Peds.AI
public bool HasTargetNode { get; private set; } = false;
/// <summary>
/// The ped that this ped is chasing
/// </summary>
public Ped TargetPed { get; private set; }
public Ped MyPed { get; private set; }
public PedestrianType PedestrianType => this.MyPed.PedDef.DefaultType;