DetourContext Dispose Fix (REPO)

DetourContext Dispose Fix repo

This is a simple patch for BepInEx that makes MonoMod.RuntimeDetour.DetourContext.Dispose work correctly.

Installation is simple, unzip the archive to REPO\BepInEx\patchers.

For Modders (What this patch does)

Code Example

using(new DetourContext(){ Priority = 100 })
{
On.StartOfRound.Awake += Hook_2;
}
On.StartOfRound.Awake += Hook_1;

Problem Before the Patch

  • DetourContext was not properly cleaning itself up.
  • As a result, Hook_1 was also affected by Priority 100 (even though it was added later).
  • This caused Hook_1 to run before Hook_2, which is incorrect.

Fix (with the patcher)

  • Now, DetourContext properly disposes itself.
  • Hook_2 gets Priority 100.
  • Hook_1 remains normal priority.
  • This ensures Hook_2 runs first, as expected.

Created by Hamunii

Download

How to Install

To install DetourContext Dispose Fix (REPO) you need to have BepInEx. If you have any trouble installing mods for REPO, follow this guide:

R.E.P.O. Mods Installation

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top