diff --git a/QSB/PlayerRegistry.cs b/QSB/PlayerRegistry.cs index a5f044fa..34237693 100644 --- a/QSB/PlayerRegistry.cs +++ b/QSB/PlayerRegistry.cs @@ -4,7 +4,6 @@ using QSB.TransformSync; using QSB.Utility; using System; using System.Collections.Generic; -using System.Diagnostics; using System.Linq; using UnityEngine; using UnityEngine.Networking; diff --git a/QSB/TransformSync/PlayerCameraSync.cs b/QSB/TransformSync/PlayerCameraSync.cs index dc4c4ef4..f12b694c 100644 --- a/QSB/TransformSync/PlayerCameraSync.cs +++ b/QSB/TransformSync/PlayerCameraSync.cs @@ -1,9 +1,7 @@ using QSB.Events; using QSB.Tools; using QSB.Utility; -using System.Reflection; using UnityEngine; -using UnityEngine.Networking; namespace QSB.TransformSync { @@ -41,6 +39,6 @@ namespace QSB.TransformSync return body.transform; } - public override bool IsReady => Locator.GetPlayerTransform() != null && PlayerRegistry.PlayerExists(Player.PlayerId); + public override bool IsReady => Locator.GetPlayerTransform() != null && Player != null && PlayerRegistry.PlayerExists(Player.PlayerId); } } diff --git a/QSB/TransformSync/PlayerProbeSync.cs b/QSB/TransformSync/PlayerProbeSync.cs index 0f990e01..84bccb2c 100644 --- a/QSB/TransformSync/PlayerProbeSync.cs +++ b/QSB/TransformSync/PlayerProbeSync.cs @@ -74,6 +74,6 @@ namespace QSB.TransformSync SyncedTransform.localPosition = ReferenceSector.Transform.InverseTransformPoint(_disabledSocket.position); } - public override bool IsReady => Locator.GetProbe() != null && PlayerRegistry.PlayerExists(Player.PlayerId) && Player.IsReady; + public override bool IsReady => Locator.GetProbe() != null && Player != null && PlayerRegistry.PlayerExists(Player.PlayerId) && Player.IsReady; } } diff --git a/QSB/TransformSync/PlayerTransformSync.cs b/QSB/TransformSync/PlayerTransformSync.cs index 266c048b..898df503 100644 --- a/QSB/TransformSync/PlayerTransformSync.cs +++ b/QSB/TransformSync/PlayerTransformSync.cs @@ -43,6 +43,6 @@ namespace QSB.TransformSync return body; } - public override bool IsReady => Locator.GetPlayerTransform() != null && PlayerRegistry.PlayerExists(Player.PlayerId) && Player.IsReady; + public override bool IsReady => Locator.GetPlayerTransform() != null && Player != null && PlayerRegistry.PlayerExists(Player.PlayerId) && Player.IsReady; } } diff --git a/QSB/TransformSync/ShipTransformSync.cs b/QSB/TransformSync/ShipTransformSync.cs index 999b050c..934844bc 100644 --- a/QSB/TransformSync/ShipTransformSync.cs +++ b/QSB/TransformSync/ShipTransformSync.cs @@ -49,6 +49,6 @@ namespace QSB.TransformSync return remoteTransform; } - public override bool IsReady => GetShipModel() != null && PlayerRegistry.PlayerExists(Player.PlayerId) && Player.IsReady; + public override bool IsReady => GetShipModel() != null && Player != null && PlayerRegistry.PlayerExists(Player.PlayerId) && Player.IsReady; } } diff --git a/QSB/TransformSync/TransformSync.cs b/QSB/TransformSync/TransformSync.cs index c68c3d49..668b06c7 100644 --- a/QSB/TransformSync/TransformSync.cs +++ b/QSB/TransformSync/TransformSync.cs @@ -103,7 +103,6 @@ namespace QSB.TransformSync public void SetReferenceSector(QSBSector sector) { - DebugLog.DebugWrite($"Setting reference sector of {Player.PlayerId.Value}.{GetType().Name} to {sector.Name}"); _positionSmoothVelocity = Vector3.zero; ReferenceSector = sector; if (!hasAuthority)