This commit is contained in:
Mister_Nebula 2020-09-02 14:06:38 +01:00
parent cef3c382ea
commit bfb2273b80
6 changed files with 4 additions and 8 deletions

View File

@ -4,7 +4,6 @@ using QSB.TransformSync;
using QSB.Utility; using QSB.Utility;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics;
using System.Linq; using System.Linq;
using UnityEngine; using UnityEngine;
using UnityEngine.Networking; using UnityEngine.Networking;

View File

@ -1,9 +1,7 @@
using QSB.Events; using QSB.Events;
using QSB.Tools; using QSB.Tools;
using QSB.Utility; using QSB.Utility;
using System.Reflection;
using UnityEngine; using UnityEngine;
using UnityEngine.Networking;
namespace QSB.TransformSync namespace QSB.TransformSync
{ {
@ -41,6 +39,6 @@ namespace QSB.TransformSync
return body.transform; return body.transform;
} }
public override bool IsReady => Locator.GetPlayerTransform() != null && PlayerRegistry.PlayerExists(Player.PlayerId); public override bool IsReady => Locator.GetPlayerTransform() != null && Player != null && PlayerRegistry.PlayerExists(Player.PlayerId);
} }
} }

View File

@ -74,6 +74,6 @@ namespace QSB.TransformSync
SyncedTransform.localPosition = ReferenceSector.Transform.InverseTransformPoint(_disabledSocket.position); SyncedTransform.localPosition = ReferenceSector.Transform.InverseTransformPoint(_disabledSocket.position);
} }
public override bool IsReady => Locator.GetProbe() != null && PlayerRegistry.PlayerExists(Player.PlayerId) && Player.IsReady; public override bool IsReady => Locator.GetProbe() != null && Player != null && PlayerRegistry.PlayerExists(Player.PlayerId) && Player.IsReady;
} }
} }

View File

@ -43,6 +43,6 @@ namespace QSB.TransformSync
return body; return body;
} }
public override bool IsReady => Locator.GetPlayerTransform() != null && PlayerRegistry.PlayerExists(Player.PlayerId) && Player.IsReady; public override bool IsReady => Locator.GetPlayerTransform() != null && Player != null && PlayerRegistry.PlayerExists(Player.PlayerId) && Player.IsReady;
} }
} }

View File

@ -49,6 +49,6 @@ namespace QSB.TransformSync
return remoteTransform; return remoteTransform;
} }
public override bool IsReady => GetShipModel() != null && PlayerRegistry.PlayerExists(Player.PlayerId) && Player.IsReady; public override bool IsReady => GetShipModel() != null && Player != null && PlayerRegistry.PlayerExists(Player.PlayerId) && Player.IsReady;
} }
} }

View File

@ -103,7 +103,6 @@ namespace QSB.TransformSync
public void SetReferenceSector(QSBSector sector) public void SetReferenceSector(QSBSector sector)
{ {
DebugLog.DebugWrite($"Setting reference sector of {Player.PlayerId.Value}.{GetType().Name} to {sector.Name}");
_positionSmoothVelocity = Vector3.zero; _positionSmoothVelocity = Vector3.zero;
ReferenceSector = sector; ReferenceSector = sector;
if (!hasAuthority) if (!hasAuthority)