Skip to content

Commit

Permalink
chore: pass harmony ID to UnpatchAll
Browse files Browse the repository at this point in the history
  • Loading branch information
bdunderscore committed Oct 2, 2024
1 parent f7bee12 commit 10bb4b1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Editor/Harmony/Patcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ namespace nadena.dev.ndmf.preview
{
internal sealed class PatchLoader
{
private const string HarmonyId = "nadena.dev.ndmf.core.preview";

private static readonly Action<Harmony>[] patches =
{
HandleUtilityPatches.Patch_FilterInstanceIDs,
Expand All @@ -22,7 +24,7 @@ internal sealed class PatchLoader
[InitializeOnLoadMethod]
static void ApplyPatches()
{
var harmony = new Harmony("nadena.dev.ndmf.core.preview");
var harmony = new Harmony(HarmonyId);

foreach (var patch in patches)
{
Expand All @@ -36,7 +38,7 @@ static void ApplyPatches()
}
}

AssemblyReloadEvents.beforeAssemblyReload += () => { harmony.UnpatchAll(); };
AssemblyReloadEvents.beforeAssemblyReload += () => { harmony.UnpatchAll(HarmonyId); };
}
}
}

0 comments on commit 10bb4b1

Please sign in to comment.