From 344ccbc1e05379b12fde22b06df6d03d17b52c68 Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Thu, 6 Oct 2022 16:18:44 -0700 Subject: [PATCH] patch DreamWorldController.ExtinguishDreamRaft since we want to prevent _lastUsedRaftProjector from being null (since we dont actually extinguish the raft) --- .../DreamRafts/Patches/DreamRaftPatches.cs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/QSB/EchoesOfTheEye/DreamRafts/Patches/DreamRaftPatches.cs b/QSB/EchoesOfTheEye/DreamRafts/Patches/DreamRaftPatches.cs index d1afc72e..c993920c 100644 --- a/QSB/EchoesOfTheEye/DreamRafts/Patches/DreamRaftPatches.cs +++ b/QSB/EchoesOfTheEye/DreamRafts/Patches/DreamRaftPatches.cs @@ -62,17 +62,21 @@ public class DreamRaftPatches : QSBPatch /// and we don't want it to extinguish with other players on it. /// [HarmonyPrefix] - [HarmonyPatch(typeof(DreamRaftProjector), nameof(DreamRaftProjector.ExtinguishImmediately))] - private static bool ExtinguishImmediately(DreamRaftProjector __instance) + [HarmonyPatch(typeof(DreamWorldController), nameof(DreamWorldController.ExtinguishDreamRaft))] + private static bool ExtinguishDreamRaft(DreamWorldController __instance) { if (!QSBWorldSync.AllObjectsReady) { return true; } - // still release authority over the raft tho - __instance._dreamRaftProjection.GetComponent().GetWorldObject() - .NetworkBehaviour.netIdentity.UpdateAuthQueue(AuthQueueAction.Remove); + if (__instance._lastUsedRaftProjector) + { + // still release authority over the raft tho + __instance._lastUsedRaftProjector + ._dreamRaftProjection.GetComponent().GetWorldObject() + .NetworkBehaviour.netIdentity.UpdateAuthQueue(AuthQueueAction.Remove); + } return false; }