diff --git a/QSB/Player/TransformSync/PlayerCameraSync.cs b/QSB/Player/TransformSync/PlayerCameraSync.cs index 1f2ef804..4a101a4c 100644 --- a/QSB/Player/TransformSync/PlayerCameraSync.cs +++ b/QSB/Player/TransformSync/PlayerCameraSync.cs @@ -8,6 +8,8 @@ namespace QSB.Player.TransformSync { public class PlayerCameraSync : SyncObjectTransformSync { + public override float DistanceLeeway => 5f; + protected override Transform InitLocalTransform() { SectorSync.SetSectorDetector(Locator.GetPlayerSectorDetector()); diff --git a/QSB/Player/TransformSync/PlayerTransformSync.cs b/QSB/Player/TransformSync/PlayerTransformSync.cs index c09c64af..871747a8 100644 --- a/QSB/Player/TransformSync/PlayerTransformSync.cs +++ b/QSB/Player/TransformSync/PlayerTransformSync.cs @@ -9,6 +9,8 @@ namespace QSB.Player.TransformSync { public static PlayerTransformSync LocalInstance { get; private set; } + public override float DistanceLeeway => 5f; + static PlayerTransformSync() => AnimControllerPatch.Init(); public override void OnStartLocalPlayer() diff --git a/QSB/ProbeSync/TransformSync/PlayerProbeSync.cs b/QSB/ProbeSync/TransformSync/PlayerProbeSync.cs index 4c84a0cc..7a23303e 100644 --- a/QSB/ProbeSync/TransformSync/PlayerProbeSync.cs +++ b/QSB/ProbeSync/TransformSync/PlayerProbeSync.cs @@ -9,7 +9,7 @@ namespace QSB.ProbeSync.TransformSync { public class PlayerProbeSync : SyncObjectTransformSync { - private Transform _disabledSocket; + public override float DistanceLeeway => 20f; private Transform GetProbe() => Locator.GetProbe().transform.Find("CameraPivot").Find("Geometry"); @@ -19,7 +19,6 @@ namespace QSB.ProbeSync.TransformSync SectorSync.SetSectorDetector(Locator.GetProbe().GetSectorDetector()); var body = GetProbe(); - SetSocket(Player.CameraBody.transform); Player.ProbeBody = body.gameObject; return body; @@ -42,20 +41,11 @@ namespace QSB.ProbeSync.TransformSync PlayerToolsManager.CreateProbe(body, Player); - QSBCore.UnityEvents.RunWhen( - () => Player.ProbeLauncher != null, - () => SetSocket(Player.ProbeLauncher.ToolGameObject.transform)); Player.ProbeBody = body.gameObject; return body; } - private void SetSocket(Transform socket) - { - DebugLog.DebugWrite($"Set DisabledSocket of id:{PlayerId}."); - _disabledSocket = socket; - } - public override bool IsReady => Locator.GetProbe() != null && Player != null && QSBPlayerManager.PlayerExists(Player.PlayerId) diff --git a/QSB/RoastingSync/TransformSync/RoastingStickTransformSync.cs b/QSB/RoastingSync/TransformSync/RoastingStickTransformSync.cs index f6493b22..8b8216de 100644 --- a/QSB/RoastingSync/TransformSync/RoastingStickTransformSync.cs +++ b/QSB/RoastingSync/TransformSync/RoastingStickTransformSync.cs @@ -9,6 +9,8 @@ namespace QSB.RoastingSync.TransformSync { internal class RoastingStickTransformSync : SyncObjectTransformSync { + public override float DistanceLeeway => 5f; + private Transform _stickTip; private Transform _networkStickTip => gameObject.transform.GetChild(0); private const float SmoothTime = 0.1f; diff --git a/QSB/ShipSync/TransformSync/ShipTransformSync.cs b/QSB/ShipSync/TransformSync/ShipTransformSync.cs index ecfa47be..a7de7faa 100644 --- a/QSB/ShipSync/TransformSync/ShipTransformSync.cs +++ b/QSB/ShipSync/TransformSync/ShipTransformSync.cs @@ -6,6 +6,8 @@ namespace QSB.ShipSync.TransformSync { public class ShipTransformSync : SyncObjectTransformSync { + public override float DistanceLeeway => 20f; + private Transform GetShipModel() => Locator.GetShipTransform(); protected override Transform InitLocalTransform() diff --git a/QSB/TransformSync/SyncObjectTransformSync.cs b/QSB/TransformSync/SyncObjectTransformSync.cs index 4c49d0b2..b2c789df 100644 --- a/QSB/TransformSync/SyncObjectTransformSync.cs +++ b/QSB/TransformSync/SyncObjectTransformSync.cs @@ -20,7 +20,7 @@ namespace QSB.TransformSync public SectorSync.SectorSync SectorSync { get; private set; } private const float SmoothTime = 0.1f; - private const float DistanceLeeway = 5f; + public abstract float DistanceLeeway { get; } private bool _isInitialized; private Vector3 _positionSmoothVelocity; private Quaternion _rotationSmoothVelocity;