Fix NRE caused by updating camera in LateUpdate()

This commit is contained in:
in0finite 2019-04-28 19:53:05 +02:00
parent 669daa23be
commit 344318f558
2 changed files with 2 additions and 2 deletions

View file

@ -467,7 +467,7 @@ namespace SanAndreasUnity.Behaviours.Peds.States
Vector3 castDir = -m_ped.Camera.transform.forward;
// use distance from gun aiming offset ?
if (m_ped.CurrentWeapon.GunAimingOffset != null)
if (m_ped.CurrentWeapon != null && m_ped.CurrentWeapon.GunAimingOffset != null)
{
// Vector3 desiredCameraPos = this.transform.TransformPoint (- _player.CurrentWeapon.GunAimingOffset.Aim) + Vector3.up * .5f;
// Vector3 desiredCameraPos = this.transform.TransformPoint( new Vector3(0.8f, 1.0f, -1) );

View file

@ -8,7 +8,7 @@
- adapt states:
- send button input events to server: crouch,
- send button input events to server:
- stats window