BepInEx / HarmonyX

Harmony built on top of MonoMod.RuntimeDetours with additional features
MIT License
329 stars 42 forks source link

Harmony Unpatch and repatching causes transpiler IL errors #81

Open YakovAU opened 10 months ago

YakovAU commented 10 months ago

Not sure if this use case can be fixed or not, but with a hot loader, it has no issue with prefix or postfix reloading, but if you reload a transpiler it will have unknown location IL errors.

ManlyMarco commented 10 months ago

Are you sure it's not caused by other transpliers running before or something similar? I'm fairly sure I've reloaded transpliers in the past with no ill effects. See if you can isolate the issue and provide a way to reproduce it. Always avoid using index offsets in transpliers and instead use CodeMatcher with ThrowIf statement scattered in between to ensure the method is what you think it is.