mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-01 03:32:38 +00:00
remove Player == null checks
This commit is contained in:
parent
b79cea5254
commit
533c7dae64
@ -127,12 +127,6 @@ namespace QSB.Syncs.Sectored
|
||||
{
|
||||
if (IsPlayerObject)
|
||||
{
|
||||
if (Player == null)
|
||||
{
|
||||
writer.Write(-1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Player.IsReady)
|
||||
{
|
||||
writer.Write(-1);
|
||||
|
@ -17,7 +17,7 @@ namespace QSB.Syncs
|
||||
public abstract class SyncBase<T> : QNetworkTransform where T : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// only valid for player objects
|
||||
/// valid if IsPlayerObject, otherwise null
|
||||
/// </summary>
|
||||
public PlayerInfo Player { get; private set; }
|
||||
|
||||
@ -37,11 +37,6 @@ namespace QSB.Syncs
|
||||
|
||||
if (IsPlayerObject)
|
||||
{
|
||||
if (Player == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!Player.IsReady && !IsLocalPlayer)
|
||||
{
|
||||
return false;
|
||||
|
@ -137,12 +137,6 @@ namespace QSB.Utility
|
||||
WriteLine(2, $"Player data :");
|
||||
foreach (var player in QSBPlayerManager.PlayerList)
|
||||
{
|
||||
if (player == null)
|
||||
{
|
||||
WriteLine(2, $"NULL PLAYER", Color.red);
|
||||
continue;
|
||||
}
|
||||
|
||||
WriteLine(2, $"{player.PlayerId}.{player.Name}");
|
||||
WriteLine(2, $"State : {player.State}");
|
||||
WriteLine(2, $"Eye State : {player.EyeState}");
|
||||
@ -227,12 +221,6 @@ namespace QSB.Utility
|
||||
|
||||
foreach (var player in QSBPlayerManager.PlayerList)
|
||||
{
|
||||
if (player == null)
|
||||
{
|
||||
WriteLine(4, $"- NULL PLAYER", Color.red);
|
||||
continue;
|
||||
}
|
||||
|
||||
WriteLine(4, $"- {player.PlayerId}.{player.Name}");
|
||||
var allQuantumObjects = QSBWorldSync.GetWorldObjects<IQSBQuantumObject>();
|
||||
var ownedQuantumObjects = allQuantumObjects.Where(x => x.ControllingPlayer == player.PlayerId);
|
||||
|
Loading…
Reference in New Issue
Block a user