mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-17 01:13:05 +00:00
patch DreamWorldController.ExtinguishDreamRaft since we want to prevent _lastUsedRaftProjector from being null (since we dont actually extinguish the raft)
This commit is contained in:
parent
5b18f682d6
commit
344ccbc1e0
@ -62,17 +62,21 @@ public class DreamRaftPatches : QSBPatch
|
||||
/// and we don't want it to extinguish with other players on it.
|
||||
/// </summary>
|
||||
[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<DreamRaftController>().GetWorldObject<QSBDreamRaft>()
|
||||
.NetworkBehaviour.netIdentity.UpdateAuthQueue(AuthQueueAction.Remove);
|
||||
if (__instance._lastUsedRaftProjector)
|
||||
{
|
||||
// still release authority over the raft tho
|
||||
__instance._lastUsedRaftProjector
|
||||
._dreamRaftProjection.GetComponent<DreamRaftController>().GetWorldObject<QSBDreamRaft>()
|
||||
.NetworkBehaviour.netIdentity.UpdateAuthQueue(AuthQueueAction.Remove);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user