exit Chase state if there is no weapon or no ammo

This commit is contained in:
in0finite 2021-10-16 22:06:54 +02:00
parent 8322c737a6
commit 51545ef571

View file

@ -37,6 +37,13 @@ namespace SanAndreasUnity.Behaviours.Peds.AI
{
this.ChooseBestWeapon();
if (null == _ped.CurrentWeapon)
{
// we have no weapon to attack with, or no ammo
_pedAI.StartWalkingAround();
return;
}
if (null == this.TargetPed)
{
this.TargetPed = this.GetNextPedToAttack();