diff --git a/QSB/Player/PlayerInfo.cs b/QSB/Player/PlayerInfo.cs index f7a6f386..cfa624a3 100644 --- a/QSB/Player/PlayerInfo.cs +++ b/QSB/Player/PlayerInfo.cs @@ -31,7 +31,7 @@ public partial class PlayerInfo public bool IsInEyeShuttle { get; set; } public IQSBQuantumObject EntangledObject { get; set; } public QSBPlayerAudioController AudioController { get; set; } - public bool IsLocalPlayer => TransformSync?.isLocalPlayer == true; + public bool IsLocalPlayer => TransformSync.isLocalPlayer; // if TransformSync is ever null, i give permission for nebula to laugh at me - johncorby public ThrusterLightTracker ThrusterLightTracker; public bool FlyingShip => ShipManager.Instance.CurrentFlyer == PlayerId; public bool WaitingForHeartbeat; diff --git a/QSB/ShipSync/TransformSync/ShipLegTransformSync.cs b/QSB/ShipSync/TransformSync/ShipLegTransformSync.cs index 1f7eb1d7..39e4db8f 100644 --- a/QSB/ShipSync/TransformSync/ShipLegTransformSync.cs +++ b/QSB/ShipSync/TransformSync/ShipLegTransformSync.cs @@ -17,9 +17,9 @@ internal class ShipLegTransformSync : SectoredRigidbodySync, ILinkedNetworkBehav protected override bool CheckReady() => base.CheckReady() - && _qsbModule != null - && _qsbModule.AttachedObject != null - && _qsbModule.AttachedObject.isDetached; + && _qsbModule != null // not sure how either of these can be null, but i guess better safe than sorry + && _qsbModule.AttachedObject != null + && _qsbModule.AttachedObject.isDetached; protected override bool UseInterpolation => true; diff --git a/QSB/ShipSync/TransformSync/ShipModuleTransformSync.cs b/QSB/ShipSync/TransformSync/ShipModuleTransformSync.cs index 00273b6f..72cb2d2d 100644 --- a/QSB/ShipSync/TransformSync/ShipModuleTransformSync.cs +++ b/QSB/ShipSync/TransformSync/ShipModuleTransformSync.cs @@ -17,9 +17,9 @@ internal class ShipModuleTransformSync : SectoredRigidbodySync, ILinkedNetworkBe protected override bool CheckReady() => base.CheckReady() - && _qsbModule != null - && _qsbModule.AttachedObject != null - && _qsbModule.AttachedObject.isDetached; + && _qsbModule != null // not sure how either of these can be null, but i guess better safe than sorry + && _qsbModule.AttachedObject != null + && _qsbModule.AttachedObject.isDetached; protected override bool UseInterpolation => true; diff --git a/QSB/Utility/DebugActions.cs b/QSB/Utility/DebugActions.cs index 728a3837..c741dffd 100644 --- a/QSB/Utility/DebugActions.cs +++ b/QSB/Utility/DebugActions.cs @@ -8,7 +8,6 @@ using QSB.Utility.Messages; using QSB.WorldSync; using System; using System.Linq; -using System.Reflection; using UnityEngine; using UnityEngine.InputSystem; @@ -227,13 +226,6 @@ public class DebugActions : MonoBehaviour, IAddComponentOnStart DebugLog.DebugWrite($"CREATING FAKE PLAYER : {player}", MessageType.Info); JoinLeaveSingularity.Create(player, true); - - if (Keyboard.current[Key.LeftShift].isPressed) - { - // this is HORRIBLE TRASH, but it's just for testing - var field = typeof(PlayerInfo).GetField($"<{nameof(PlayerInfo.TransformSync)}>k__BackingField", BindingFlags.Instance | BindingFlags.NonPublic); - field.SetValue(player, null); - } } if (Keyboard.current[Key.Numpad9].wasPressedThisFrame)