diff --git a/QSB/Player/QSBPlayerManager.cs b/QSB/Player/QSBPlayerManager.cs index e1704c1d..d62b8e47 100644 --- a/QSB/Player/QSBPlayerManager.cs +++ b/QSB/Player/QSBPlayerManager.cs @@ -27,7 +27,7 @@ namespace QSB.Player return localInstance.Player; } } - public static uint LocalPlayerId => LocalPlayer.PlayerId; + public static uint LocalPlayerId => LocalPlayer?.PlayerId ?? uint.MaxValue; /// /// called right after player is added diff --git a/QSB/QSBCore.cs b/QSB/QSBCore.cs index c5475462..d70aaffa 100644 --- a/QSB/QSBCore.cs +++ b/QSB/QSBCore.cs @@ -113,11 +113,9 @@ namespace QSB // WorldObject managers QSBWorldSync.Managers = typeof(WorldObjectManager).GetDerivedTypes() - .Select(x => (WorldObjectManager)this.gameObject.AddComponent(x)) + .Select(x => (WorldObjectManager)gameObject.AddComponent(x)) .ToArray(); - Helper.HarmonyHelper.EmptyMethod("Update"); - QSBPatchManager.OnPatchType += OnPatchType; QSBPatchManager.OnUnpatchType += OnUnpatchType; }