remove Player == null checks

This commit is contained in:
JohnCorby 2022-01-07 15:38:22 -08:00
parent b79cea5254
commit 533c7dae64
3 changed files with 1 additions and 24 deletions

View File

@ -127,12 +127,6 @@ namespace QSB.Syncs.Sectored
{
if (IsPlayerObject)
{
if (Player == null)
{
writer.Write(-1);
return;
}
if (!Player.IsReady)
{
writer.Write(-1);

View File

@ -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;

View File

@ -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);