Check worldobjectmanager is ready before doing stuff

This commit is contained in:
Mister_Nebula 2021-07-17 09:53:13 +01:00
parent d09717c06f
commit 44e1729c85
2 changed files with 10 additions and 0 deletions

View File

@ -23,6 +23,11 @@ namespace QSB.SectorSync
public void Invoke()
{
if (!Instance.IsReady || !AllReady)
{
return;
}
foreach (var sync in SectoredTransformSyncs)
{
if (sync.AttachedObject == null)

View File

@ -38,6 +38,11 @@ namespace QSB.WorldSync
where TWorldObject : WorldObject<TUnityObject>
where TUnityObject : MonoBehaviour
{
if (!WorldObjectManager.AllReady)
{
return default;
}
if (unityObject == null)
{
DebugLog.ToConsole($"Error - Trying to run GetWorldFromUnity with a null unity object! TWorldObject:{typeof(TWorldObject).Name}, TUnityObject:{typeof(TUnityObject).Name}.", MessageType.Error);