diff --git a/QSB/EyeOfTheUniverse/ForestOfGalaxies/Patches/ForestPatches.cs b/QSB/EyeOfTheUniverse/ForestOfGalaxies/Patches/ForestPatches.cs index 7d9edfc0..69105cb7 100644 --- a/QSB/EyeOfTheUniverse/ForestOfGalaxies/Patches/ForestPatches.cs +++ b/QSB/EyeOfTheUniverse/ForestOfGalaxies/Patches/ForestPatches.cs @@ -32,11 +32,11 @@ namespace QSB.EyeOfTheUniverse.ForestOfGalaxies.Patches } if ((Locator.GetProbe() != null && Locator.GetProbe().IsAnchored()) - || QSBPlayerManager.PlayerList.Where(x => x != QSBPlayerManager.LocalPlayer).Any(x => x.Probe != null && x.Probe.IsAnchored())) + || QSBPlayerManager.PlayerList.Where(x => !x.IsLocalPlayer).Any(x => x.Probe != null && x.Probe.IsAnchored())) { foreach (var player in QSBPlayerManager.PlayerList) { - if (player == QSBPlayerManager.LocalPlayer + if (player.IsLocalPlayer && Locator.GetProbe() != null && Locator.GetProbe().IsAnchored()) { diff --git a/QSB/Player/PlayerInfo.cs b/QSB/Player/PlayerInfo.cs index 4ffdb5dc..6c1b9d42 100644 --- a/QSB/Player/PlayerInfo.cs +++ b/QSB/Player/PlayerInfo.cs @@ -35,7 +35,7 @@ namespace QSB.Player public ClientState State { get; set; } public EyeState EyeState { get; set; } public bool IsDead { get; set; } - public bool Visible => DitheringAnimator != null && DitheringAnimator._visible; + public bool Visible => IsLocalPlayer || DitheringAnimator && DitheringAnimator._visible; public bool IsReady { get; set; } public bool IsInMoon { get; set; } public bool IsInShrine { get; set; } @@ -44,6 +44,8 @@ namespace QSB.Player public QSBPlayerAudioController AudioController { get; set; } public DitheringAnimator DitheringAnimator { get; set; } + public bool IsLocalPlayer => TransformSync.isLocalPlayer; + // Body Objects public OWCamera Camera { @@ -136,7 +138,7 @@ namespace QSB.Player { get { - if (QSBPlayerManager.LocalPlayer != this) + if (!IsLocalPlayer) { DebugLog.ToConsole($"Warning - Tried to access local-only property LocalProbeLauncher in PlayerInfo for non local player!", MessageType.Warning); return null; @@ -150,7 +152,7 @@ namespace QSB.Player { get { - if (QSBPlayerManager.LocalPlayer != this) + if (!IsLocalPlayer) { DebugLog.ToConsole($"Warning - Tried to access local-only property LocalFlashlight in PlayerInfo for non local player!", MessageType.Warning); return null; @@ -164,7 +166,7 @@ namespace QSB.Player { get { - if (QSBPlayerManager.LocalPlayer != this) + if (!IsLocalPlayer) { DebugLog.ToConsole($"Warning - Tried to access local-only property LocalSignalscope in PlayerInfo for non local player!", MessageType.Warning); return null; @@ -178,7 +180,7 @@ namespace QSB.Player { get { - if (QSBPlayerManager.LocalPlayer != this) + if (!IsLocalPlayer) { DebugLog.ToConsole($"Warning - Tried to access local-only property LocalTranslator in PlayerInfo for non local player!", MessageType.Warning); return null; diff --git a/QSB/PoolSync/CustomNomaiRemoteCameraPlatform.cs b/QSB/PoolSync/CustomNomaiRemoteCameraPlatform.cs index 0a9534cb..ed3fea0b 100644 --- a/QSB/PoolSync/CustomNomaiRemoteCameraPlatform.cs +++ b/QSB/PoolSync/CustomNomaiRemoteCameraPlatform.cs @@ -675,7 +675,7 @@ namespace QSB.PoolSync public void OnRemovePlayer(PlayerInfo player) { - if (player == QSBPlayerManager.LocalPlayer) + if (player.IsLocalPlayer) { return; } diff --git a/QSB/TriggerSync/WorldObjects/QSBInflationTrigger.cs b/QSB/TriggerSync/WorldObjects/QSBInflationTrigger.cs index 3a538156..f20c1ef5 100644 --- a/QSB/TriggerSync/WorldObjects/QSBInflationTrigger.cs +++ b/QSB/TriggerSync/WorldObjects/QSBInflationTrigger.cs @@ -21,7 +21,7 @@ namespace QSB.TriggerSync.WorldObjects return; } - if (player == QSBPlayerManager.LocalPlayer) + if (player.IsLocalPlayer) { AttachedObject.OnEntry -= OnEnterEvent; diff --git a/QSB/Utility/DebugActions.cs b/QSB/Utility/DebugActions.cs index 7e190993..8a60f42e 100644 --- a/QSB/Utility/DebugActions.cs +++ b/QSB/Utility/DebugActions.cs @@ -55,7 +55,7 @@ namespace QSB.Utility if (Keyboard.current[Key.Numpad1].wasPressedThisFrame) { - var otherPlayer = QSBPlayerManager.PlayerList.FirstOrDefault(x => x != QSBPlayerManager.LocalPlayer); + var otherPlayer = QSBPlayerManager.PlayerList.FirstOrDefault(x => !x.IsLocalPlayer); if (otherPlayer != null) { new DebugRequestTeleportInfoMessage(otherPlayer.PlayerId).Send();