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:
parent
854b0c1856
commit
63ce71bec6
2 changed files with 2 additions and 2 deletions
Assets/Scripts/Behaviours/Ped/States
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue