fix trying to get attached ow rigidbody from null sector

This commit is contained in:
Mister_Nebula 2021-05-19 11:57:44 +01:00
parent a35d4790aa
commit 18219cd7ef

View File

@ -178,11 +178,14 @@ namespace QSB
offset3 += _debugLineSpacing;
GUI.Label(new Rect(420, offset3, 200f, 20f), $"Ship sector : {(ship.ReferenceSector == null ? "NULL" : ship.ReferenceSector.Name)}");
offset3 += _debugLineSpacing;
GUI.Label(new Rect(420, offset3, 400f, 20f), $"Ship relative velocity : {ship.AttachedObject.GetRelativeVelocity(ship.ReferenceTransform.GetAttachedOWRigidbody())}");
offset3 += _debugLineSpacing;
offset3 += _debugLineSpacing;
GUI.Label(new Rect(420, offset3, 400f, 20f), $"Ship velocity mag. : {ship.GetVelocityChangeMagnitude()}");
offset3 += _debugLineSpacing;
if (ship.ReferenceTransform != null)
{
GUI.Label(new Rect(420, offset3, 400f, 20f), $"Ship relative velocity : {ship.AttachedObject.GetRelativeVelocity(ship.ReferenceTransform.GetAttachedOWRigidbody())}");
offset3 += _debugLineSpacing;
offset3 += _debugLineSpacing;
GUI.Label(new Rect(420, offset3, 400f, 20f), $"Ship velocity mag. : {ship.GetVelocityChangeMagnitude()}");
offset3 += _debugLineSpacing;
}
}