fix WakeUpSync stuff

This commit is contained in:
_nebula 2023-03-09 16:38:17 +00:00
parent 5de1c5c07a
commit 0b039ce792
2 changed files with 4 additions and 4 deletions

View File

@ -33,5 +33,5 @@ public class ServerTimeMessage : QSBMessage
}
public override void OnReceiveRemote()
=> WakeUpSync.LocalInstance.OnClientReceiveMessage(ServerTime, LoopCount, SecondsRemaining);
=> WakeUpSync.LocalInstance?.OnClientReceiveMessage(ServerTime, LoopCount, SecondsRemaining);
}

View File

@ -54,8 +54,6 @@ public class WakeUpSync : MonoBehaviour, IAddComponentOnStart
public void Start()
{
LocalInstance = this;
if (QSBSceneManager.IsInUniverse)
{
Init();
@ -99,10 +97,12 @@ public class WakeUpSync : MonoBehaviour, IAddComponentOnStart
_hasWokenUp = true;
}
LocalInstance = this;
Init();
}
else
{
LocalInstance = null;
CurrentState = State.NotLoaded;
}
}
@ -263,7 +263,7 @@ public class WakeUpSync : MonoBehaviour, IAddComponentOnStart
{
UpdateServer();
}
else if (!QSBCore.DebugSettings.AvoidTimeSync)
else if (NetworkClient.active && QSBSceneManager.IsInUniverse && !QSBCore.DebugSettings.AvoidTimeSync)
{
UpdateClient();
}