2
0
Fork 0
mirror of https://github.com/GTA-ASM/SanAndreasUnity synced 2025-03-05 07:37:17 +00:00

check if anim state is null

This commit is contained in:
in0finite 2019-07-11 23:26:45 +02:00
parent 854b0c1856
commit 63ce71bec6
2 changed files with 2 additions and 2 deletions
Assets/Scripts/Behaviours/Ped/States

View file

@ -131,7 +131,7 @@ namespace SanAndreasUnity.Behaviours.Peds.States
animState.wrapMode = WrapMode.Once;
// wait until anim is finished or vehicle is destroyed
while (animState.enabled && this.CurrentVehicle != null)
while (animState != null && animState.enabled && this.CurrentVehicle != null)
{
yield return new WaitForEndOfFrame();
}

View file

@ -91,7 +91,7 @@ namespace SanAndreasUnity.Behaviours.Peds.States
animState.wrapMode = WrapMode.Once;
// wait until anim finishes or stops
while (animState.enabled)
while (animState != null && animState.enabled)
yield return new WaitForEndOfFrame();
}