mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-22 20:13:02 +00:00
prevent possible NRE
This commit is contained in:
parent
59ca8f3d77
commit
1a7a4d5471
1 changed files with 6 additions and 1 deletions
|
@ -43,7 +43,7 @@ namespace SanAndreasUnity.Behaviours.Peds.States
|
|||
// return;
|
||||
|
||||
CrouchState.AdjustRootFramePosition(m_ped);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public static void AdjustRootFramePosition(Ped ped)
|
||||
|
@ -52,6 +52,11 @@ namespace SanAndreasUnity.Behaviours.Peds.States
|
|||
|
||||
var model = ped.PlayerModel;
|
||||
|
||||
if (null == model.RootFrame)
|
||||
return;
|
||||
if (null == model.UnnamedFrame)
|
||||
return;
|
||||
|
||||
// for some reason, y position always remains 0.25
|
||||
// m_model.UnnamedFrame.transform.localPosition = m_model.UnnamedFrame.transform.localPosition.WithXAndZ();
|
||||
|
||||
|
|
Loading…
Reference in a new issue