-
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated and fixed
ReplaceMethod
(#499)
- The opcode of replaced method is based on the new method, rather than the one it replaces - Added `extraInstructionsAfter` argument to insert instructions after the targeted code instruction - The `extraInstructions` argument was renamed to `extraInstructionsBefore` - Made the method replacement (and the argument for it) optional - The method can now be used to insert extra instructions before/after the targeted method without replacing it - An exception will be thrown if the `IEnumerable<CodeInstruction>` is null - It feels like the best course of action, as not doing anything will cause an exception later on and returning anything (or nothing) could have an unexpected consequences - An error will be displayed if the method was provided a null target method - An error will be displayed if the method was not provided a replacement method or a function to insert extra instructions - Updated the compat for "A RimWorld of Magic" to support the new method signature
- Loading branch information
1 parent
6eb6d18
commit 60f95c6
Showing
2 changed files
with
38 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters