fix thruster variable syncer trying to get the local player before local player exists

This commit is contained in:
JohnCorby 2022-09-02 22:53:30 -07:00
parent 4aa8c2bd82
commit 3cf3728e80
2 changed files with 5 additions and 8 deletions

View File

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

View File

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