From 3cf3728e800fb8acc1bb57dd747865d7d66bfd39 Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Fri, 2 Sep 2022 22:53:30 -0700 Subject: [PATCH] fix thruster variable syncer trying to get the local player before local player exists --- QSB/ModelShip/ModelShipThrusterVariableSyncer.cs | 9 +++------ QSB/ShipSync/ShipThrusterVariableSyncer.cs | 4 ++-- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/QSB/ModelShip/ModelShipThrusterVariableSyncer.cs b/QSB/ModelShip/ModelShipThrusterVariableSyncer.cs index 30c82784..3e896587 100644 --- a/QSB/ModelShip/ModelShipThrusterVariableSyncer.cs +++ b/QSB/ModelShip/ModelShipThrusterVariableSyncer.cs @@ -1,9 +1,6 @@ -using Mirror; -using QSB.Player; -using QSB.Utility; +using QSB.Player; +using QSB.Player.TransformSync; using QSB.Utility.VariableSync; -using System.Collections.Generic; -using System.Linq; using UnityEngine; namespace QSB.ModelShip; @@ -26,7 +23,7 @@ public class ModelShipThrusterVariableSyncer : MonoBehaviour public void Update() { - if (QSBPlayerManager.LocalPlayer.FlyingModelShip) + if (PlayerTransformSync.LocalInstance && QSBPlayerManager.LocalPlayer.FlyingModelShip) { GetFromShip(); return; diff --git a/QSB/ShipSync/ShipThrusterVariableSyncer.cs b/QSB/ShipSync/ShipThrusterVariableSyncer.cs index c8e31673..bb722be1 100644 --- a/QSB/ShipSync/ShipThrusterVariableSyncer.cs +++ b/QSB/ShipSync/ShipThrusterVariableSyncer.cs @@ -1,7 +1,7 @@ using Mirror; using QSB.Player; +using QSB.Player.TransformSync; using QSB.Utility.VariableSync; -using QSB.WorldSync; using UnityEngine; namespace QSB.ShipSync; @@ -21,7 +21,7 @@ public class ShipThrusterVariableSyncer : NetworkBehaviour public void Update() { - if (QSBPlayerManager.LocalPlayer.FlyingShip) + if (PlayerTransformSync.LocalInstance && QSBPlayerManager.LocalPlayer.FlyingShip) { GetFromShip(); return;