Patch an IEnumerator? #379
-
Does anyone know how to patch an IEnumerator with Harmony? I actually can't find much on Google relating to this and the only code example I found claiming to explain how to patch an IEnumerator I just couldn't understand the way in which it applied to my situation. Probably a super simple question, I know, but in my brief history with BepInEx/Harmony I've not had to deal with this issue before and just writing 'IEnumerator' instead of 'void' for the patch didn't work at all, I got an error reading: I also tried going around the issue by instead patching the function that executes the coroutine itself and running my own IEnumerator that is just an altered copy of the one in the game, but then how would I tie that new IEnumerator to an instance under the way Harmony works? Also, sorry if I don't get back right away, gotta go to bed soon : ) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Greetings! With HarmonyX (Harmony variant that's bundled with BepInEx 5) you can use its helpers to patch enumerators. |
Beta Was this translation helpful? Give feedback.
Greetings!
With HarmonyX (Harmony variant that's bundled with BepInEx 5) you can use its helpers to patch enumerators.