add null referencetransform check

This commit is contained in:
Mister_Nebula 2021-05-19 11:43:39 +01:00
parent 66a0d80e8b
commit 1f2bda1f82
3 changed files with 30 additions and 8 deletions

View File

@ -153,6 +153,11 @@ namespace QSB.Syncs.RigidbodySync
return;
}
if (ReferenceTransform == null)
{
return;
}
UpdateTransform();
base.Update();
@ -225,7 +230,11 @@ namespace QSB.Syncs.RigidbodySync
private void OnRenderObject()
{
if (!QSBCore.WorldObjectsReady || !QSBCore.DebugMode || !QSBCore.ShowLinesInDebug || !IsReady)
if (!QSBCore.WorldObjectsReady
|| !QSBCore.DebugMode
|| !QSBCore.ShowLinesInDebug
|| !IsReady
|| ReferenceTransform == null)
{
return;
}

View File

@ -177,6 +177,11 @@ namespace QSB.Syncs.TransformSync
return;
}
if (ReferenceTransform == null)
{
return;
}
UpdateTransform();
base.Update();
@ -262,12 +267,11 @@ namespace QSB.Syncs.TransformSync
private void OnRenderObject()
{
if (!QSBCore.WorldObjectsReady || !QSBCore.DebugMode || !QSBCore.ShowLinesInDebug || !IsReady)
{
return;
}
if (ReferenceTransform == null)
if (!QSBCore.WorldObjectsReady
|| !QSBCore.DebugMode
|| !QSBCore.ShowLinesInDebug
|| !IsReady
|| ReferenceTransform == null)
{
return;
}

View File

@ -130,6 +130,11 @@ namespace QSB.Syncs.TransformSync
return;
}
if (ReferenceTransform == null)
{
return;
}
UpdateTransform();
base.Update();
@ -191,7 +196,11 @@ namespace QSB.Syncs.TransformSync
private void OnRenderObject()
{
if (!QSBCore.WorldObjectsReady || !QSBCore.DebugMode || !QSBCore.ShowLinesInDebug || !IsReady)
if (!QSBCore.WorldObjectsReady
|| !QSBCore.DebugMode
|| !QSBCore.ShowLinesInDebug
|| !IsReady
|| ReferenceTransform == null)
{
return;
}