mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2025-02-16 21:08:28 +00:00
when chasing is finished, start walking from closest node
This commit is contained in:
parent
82363bff84
commit
1ed58b7f09
1 changed files with 13 additions and 8 deletions
|
@ -126,14 +126,7 @@ namespace SanAndreasUnity.Behaviours
|
|||
this.UpdateWalkingAround();
|
||||
break;
|
||||
case PedAIAction.Chasing:
|
||||
if (this.TargetPed != null)
|
||||
{
|
||||
this.UpdateAttackOnPed(this.TargetPed);
|
||||
}
|
||||
else // The target is dead/disconnected
|
||||
{
|
||||
this.Action = PedAIAction.WalkingAround;
|
||||
}
|
||||
this.UpdateChasing();
|
||||
break;
|
||||
case PedAIAction.Escaping:
|
||||
this.UpdateEscaping();
|
||||
|
@ -200,6 +193,18 @@ namespace SanAndreasUnity.Behaviours
|
|||
this.MyPed.Heading = this.MyPed.Movement;
|
||||
}
|
||||
|
||||
void UpdateChasing()
|
||||
{
|
||||
if (this.TargetPed != null)
|
||||
{
|
||||
this.UpdateAttackOnPed(this.TargetPed);
|
||||
}
|
||||
else // The target is dead/disconnected
|
||||
{
|
||||
this.StartWalkingAround();
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateEscaping()
|
||||
{
|
||||
if (this.ArrivedAtDestinationNode())
|
||||
|
|
Loading…
Add table
Reference in a new issue