moved patches

This commit is contained in:
Aleksander Waage 2020-08-23 15:51:45 +02:00
parent fc2ae461d8
commit c22b0ab069
4 changed files with 12 additions and 5 deletions

View File

@ -24,5 +24,12 @@ namespace QSB.DeathSync
{
GlobalMessenger<DeathType>.FireEvent(EventNames.QSBPlayerDeath, deathType);
}
public static void Patch()
{
QSB.Helper.HarmonyHelper.AddPrefix<DeathManager>("KillPlayer", typeof(DeathPatches), nameof(PreFinishDeathSequence));
QSB.Helper.HarmonyHelper.AddPostfix<DeathManager>("KillPlayer", typeof(DeathPatches), nameof(BroadcastDeath));
}
}
}

View File

@ -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

View File

@ -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<NetworkManagerHUD>("Update");
QSB.Helper.HarmonyHelper.AddPrefix<DeathManager>("KillPlayer", typeof(DeathPatches), nameof(DeathPatches.PreFinishDeathSequence));
QSB.Helper.HarmonyHelper.AddPostfix<DeathManager>("KillPlayer", typeof(DeathPatches), nameof(DeathPatches.BroadcastDeath));
}
private string GetPlayerName()

View File

@ -18,7 +18,7 @@ namespace QSB.Tools
return true;
}
public static void DoPatches()
public static void Patch()
{
QSB.Helper.HarmonyHelper.AddPostfix<SurveyorProbe>("OnAnchor", typeof(ProbePatches), nameof(ProbeAnchor));
QSB.Helper.HarmonyHelper.AddPrefix<SurveyorProbe>("Retrieve", typeof(ProbePatches), nameof(ProbeWarp));