From 2e80ca71d432714d20203bbf3c462719a21d5e9c Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Tue, 2 Aug 2022 21:19:23 -0700 Subject: [PATCH] fix the NRE by just waiting like previously lmao --- QSB/TimeSync/WakeUpSync.cs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/QSB/TimeSync/WakeUpSync.cs b/QSB/TimeSync/WakeUpSync.cs index c22ee944..0fd5d8b7 100644 --- a/QSB/TimeSync/WakeUpSync.cs +++ b/QSB/TimeSync/WakeUpSync.cs @@ -9,6 +9,7 @@ using QSB.Player; using QSB.Player.Messages; using QSB.TimeSync.Messages; using QSB.Utility; +using QSB.WorldSync; using System; using UnityEngine; @@ -128,10 +129,10 @@ public class WakeUpSync : NetworkBehaviour } else { - // dont bother sleeping, just instantly wake up + // dont bother sleeping, just wake up if (!_hasWokenUp) { - WakeUp(); + Delay.RunWhen(() => QSBWorldSync.AllObjectsReady, WakeUp); } } } @@ -177,7 +178,8 @@ public class WakeUpSync : NetworkBehaviour } else { - WakeUp(); + // should only happen from Init so we gotta wait + Delay.RunWhen(() => QSBWorldSync.AllObjectsReady, WakeUp); } } @@ -252,9 +254,6 @@ public class WakeUpSync : NetworkBehaviour } } - /// - /// BUG: nre's but it seems to be okay? do further testing - /// private void WakeUp() => Locator.GetPlayerCamera().GetComponent().WakeUp();