add null check to DeathPositionWorld getter

This commit is contained in:
Mister_Nebula 2021-07-31 09:53:14 +01:00
parent 532bbb7658
commit 39ad5862e9

View File

@ -28,8 +28,10 @@ namespace QSB.DeathSync
private Vector3 _deathPositionRelative;
public Transform DeathClosestAstroObject { get; private set; }
public Vector3 DeathPositionWorld
=> DeathClosestAstroObject.TransformPoint(_deathPositionRelative);
public Vector3 DeathPositionWorld
=> DeathClosestAstroObject == null
? Vector3.zero
: DeathClosestAstroObject.TransformPoint(_deathPositionRelative);
public Vector3 DeathPlayerUpVector { get; private set; }
public Vector3 DeathPlayerForwardVector { get; private set; }