mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-02-20 15:41:01 +00:00
PlayerInfo.IsLocalPlayer
This commit is contained in:
parent
feed84d88d
commit
c7dc811533
@ -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())
|
||||
{
|
||||
|
@ -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;
|
||||
|
@ -675,7 +675,7 @@ namespace QSB.PoolSync
|
||||
|
||||
public void OnRemovePlayer(PlayerInfo player)
|
||||
{
|
||||
if (player == QSBPlayerManager.LocalPlayer)
|
||||
if (player.IsLocalPlayer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ namespace QSB.TriggerSync.WorldObjects
|
||||
return;
|
||||
}
|
||||
|
||||
if (player == QSBPlayerManager.LocalPlayer)
|
||||
if (player.IsLocalPlayer)
|
||||
{
|
||||
AttachedObject.OnEntry -= OnEnterEvent;
|
||||
|
||||
|
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user