prevent possible NRE

This commit is contained in:
in0finite 2019-07-13 16:19:59 +02:00
parent 59ca8f3d77
commit 1a7a4d5471

View file

@ -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();