patch DreamWorldController.ExtinguishDreamRaft since we want to prevent _lastUsedRaftProjector from being null (since we dont actually extinguish the raft)

This commit is contained in:
JohnCorby 2022-10-06 16:18:44 -07:00
parent 5b18f682d6
commit 344ccbc1e0

View File

@ -62,17 +62,21 @@ public class DreamRaftPatches : QSBPatch
/// and we don't want it to extinguish with other players on it. /// and we don't want it to extinguish with other players on it.
/// </summary> /// </summary>
[HarmonyPrefix] [HarmonyPrefix]
[HarmonyPatch(typeof(DreamRaftProjector), nameof(DreamRaftProjector.ExtinguishImmediately))] [HarmonyPatch(typeof(DreamWorldController), nameof(DreamWorldController.ExtinguishDreamRaft))]
private static bool ExtinguishImmediately(DreamRaftProjector __instance) private static bool ExtinguishDreamRaft(DreamWorldController __instance)
{ {
if (!QSBWorldSync.AllObjectsReady) if (!QSBWorldSync.AllObjectsReady)
{ {
return true; return true;
} }
// still release authority over the raft tho if (__instance._lastUsedRaftProjector)
__instance._dreamRaftProjection.GetComponent<DreamRaftController>().GetWorldObject<QSBDreamRaft>() {
.NetworkBehaviour.netIdentity.UpdateAuthQueue(AuthQueueAction.Remove); // still release authority over the raft tho
__instance._lastUsedRaftProjector
._dreamRaftProjection.GetComponent<DreamRaftController>().GetWorldObject<QSBDreamRaft>()
.NetworkBehaviour.netIdentity.UpdateAuthQueue(AuthQueueAction.Remove);
}
return false; return false;
} }