diff --git a/QSB/DeathSync/DeathPatches.cs b/QSB/DeathSync/DeathPatches.cs index a7b15b1a..2d8760b7 100644 --- a/QSB/DeathSync/DeathPatches.cs +++ b/QSB/DeathSync/DeathPatches.cs @@ -24,5 +24,12 @@ namespace QSB.DeathSync { GlobalMessenger.FireEvent(EventNames.QSBPlayerDeath, deathType); } + + public static void Patch() + { + QSB.Helper.HarmonyHelper.AddPrefix("KillPlayer", typeof(DeathPatches), nameof(PreFinishDeathSequence)); + QSB.Helper.HarmonyHelper.AddPostfix("KillPlayer", typeof(DeathPatches), nameof(BroadcastDeath)); + } + } } \ No newline at end of file diff --git a/QSB/QSB.cs b/QSB/QSB.cs index c959ed74..aeaf019e 100644 --- a/QSB/QSB.cs +++ b/QSB/QSB.cs @@ -1,5 +1,6 @@ using OWML.Common; using OWML.ModHelper; +using QSB.DeathSync; using QSB.ElevatorSync; using QSB.GeyserSync; using QSB.Tools; @@ -30,7 +31,9 @@ namespace QSB NetworkAssetBundle = Helper.Assets.LoadBundle("assets/network"); DebugLog.LogState("NetworkBundle", NetworkAssetBundle); - ProbePatches.DoPatches(); + + ProbePatches.Patch(); + DeathPatches.Patch(); // Turns out these are very finicky about what order they go. QSBNetworkManager seems to // want to go first-ish, otherwise the NetworkManager complains about the PlayerPrefab being diff --git a/QSB/QSBNetworkLobby.cs b/QSB/QSBNetworkLobby.cs index 160622a5..a19582a4 100644 --- a/QSB/QSBNetworkLobby.cs +++ b/QSB/QSBNetworkLobby.cs @@ -1,5 +1,4 @@ using OWML.ModHelper.Events; -using QSB.DeathSync; using System; using System.Linq; using UnityEngine; @@ -42,8 +41,6 @@ namespace QSB PlayerName = GetPlayerName(); CanEditName = true; QSB.Helper.HarmonyHelper.EmptyMethod("Update"); - QSB.Helper.HarmonyHelper.AddPrefix("KillPlayer", typeof(DeathPatches), nameof(DeathPatches.PreFinishDeathSequence)); - QSB.Helper.HarmonyHelper.AddPostfix("KillPlayer", typeof(DeathPatches), nameof(DeathPatches.BroadcastDeath)); } private string GetPlayerName() diff --git a/QSB/Tools/ProbePatches.cs b/QSB/Tools/ProbePatches.cs index 60fed631..f64aaf98 100644 --- a/QSB/Tools/ProbePatches.cs +++ b/QSB/Tools/ProbePatches.cs @@ -18,7 +18,7 @@ namespace QSB.Tools return true; } - public static void DoPatches() + public static void Patch() { QSB.Helper.HarmonyHelper.AddPostfix("OnAnchor", typeof(ProbePatches), nameof(ProbeAnchor)); QSB.Helper.HarmonyHelper.AddPrefix("Retrieve", typeof(ProbePatches), nameof(ProbeWarp));