From 12174c0d047c3c631edff38636ab39f252a3c3c1 Mon Sep 17 00:00:00 2001 From: Mister_Nebula <41904486+misternebula@users.noreply.github.com> Date: Wed, 29 Jul 2020 15:07:07 +0100 Subject: [PATCH] Fix connection issues when joining existing game from menu (#100) * fix it --- QSB/TransformSync/PlayerCameraSync.cs | 2 +- QSB/TransformSync/PlayerTransformSync.cs | 4 +--- QSB/TransformSync/ShipTransformSync.cs | 2 -- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/QSB/TransformSync/PlayerCameraSync.cs b/QSB/TransformSync/PlayerCameraSync.cs index 82acd3ce..805c3f71 100644 --- a/QSB/TransformSync/PlayerCameraSync.cs +++ b/QSB/TransformSync/PlayerCameraSync.cs @@ -48,7 +48,7 @@ namespace QSB.TransformSync protected override bool IsReady() { - return Locator.GetPlayerTransform() != null; + return Locator.GetPlayerTransform() != null && PlayerRegistry.PlayerExists(GetAttachedNetId()); } } } diff --git a/QSB/TransformSync/PlayerTransformSync.cs b/QSB/TransformSync/PlayerTransformSync.cs index a5464eb1..b781b299 100644 --- a/QSB/TransformSync/PlayerTransformSync.cs +++ b/QSB/TransformSync/PlayerTransformSync.cs @@ -31,7 +31,6 @@ namespace QSB.TransformSync protected override Transform InitLocalTransform() { - DebugLog.ToConsole("PlayerSync local " + GetAttachedNetId()); var body = GetPlayerModel(); bodyTransform = body; @@ -45,7 +44,6 @@ namespace QSB.TransformSync protected override Transform InitRemoteTransform() { - DebugLog.ToConsole("PlayerSync remote " + GetAttachedNetId()); var body = Instantiate(GetPlayerModel()); bodyTransform = body; @@ -62,7 +60,7 @@ namespace QSB.TransformSync protected override bool IsReady() { - return Locator.GetPlayerTransform() != null; + return Locator.GetPlayerTransform() != null && PlayerRegistry.PlayerExists(GetAttachedNetId()); } } } diff --git a/QSB/TransformSync/ShipTransformSync.cs b/QSB/TransformSync/ShipTransformSync.cs index 8d1fa4e6..710e61d5 100644 --- a/QSB/TransformSync/ShipTransformSync.cs +++ b/QSB/TransformSync/ShipTransformSync.cs @@ -30,13 +30,11 @@ namespace QSB.TransformSync protected override Transform InitLocalTransform() { - DebugLog.ToConsole("ShipSync local " + GetAttachedNetId()); return GetShipModel().Find("Module_Cockpit/Geo_Cockpit/Cockpit_Geometry/Cockpit_Exterior"); } protected override Transform InitRemoteTransform() { - DebugLog.ToConsole("ShipSync remote " + GetAttachedNetId()); var shipModel = GetShipModel(); var remoteTransform = new GameObject().transform;