Skip to content

Commit

Permalink
Swap Before/After for legacy (IL)Hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
Popax21 committed Aug 8, 2023
1 parent c86c893 commit 155656d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Celeste.Mod.mm/Mod/Helpers/LegacyMonoMod/Detour.cs
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,8 @@ private void _Refresh() {

actualHook?.Dispose();
if (IsApplied) {
actualHook = new Hook(Method, (MethodInfo) Target, new DetourConfig(ID, Priority, Before, After));
// Before/After are swapped on reorg ._.
actualHook = new Hook(Method, (MethodInfo) Target, new DetourConfig(ID, Priority, After, Before));
GC.SuppressFinalize(actualHook);

// Update the trampoline detour
Expand Down
3 changes: 2 additions & 1 deletion Celeste.Mod.mm/Mod/Helpers/LegacyMonoMod/ILHook.cs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ private void _Refresh() {

actualHook?.Dispose();
if (IsApplied) {
actualHook = new ILHook(Method, Manipulator, new DetourConfig(ID, Priority, Before, After));
// Before/After are swapped on reorg ._.
actualHook = new ILHook(Method, Manipulator, new DetourConfig(ID, Priority, After, Before));
GC.SuppressFinalize(actualHook);
} else
actualHook = null;
Expand Down

0 comments on commit 155656d

Please sign in to comment.