diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2020-05-29 21:27:00 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-29 21:27:00 -0400 |
commit | 5be3f14bf1306781665466c40931e0e3af130b68 (patch) | |
tree | 4da3f9fbb89d44aefcb01a09d8fe8b8bc85988c3 /src/SMAPI | |
parent | 01b6e4ac3252a3ac8aa8046b5b97000fce13d576 (diff) | |
parent | f817039a3a71e6e67c3bebb5e7fbd189c9a5da87 (diff) | |
download | SMAPI-5be3f14bf1306781665466c40931e0e3af130b68.tar.gz SMAPI-5be3f14bf1306781665466c40931e0e3af130b68.tar.bz2 SMAPI-5be3f14bf1306781665466c40931e0e3af130b68.zip |
Merge pull request #715 from ZaneYork/develop
Bug fix: make it possible for multi patch
Diffstat (limited to 'src/SMAPI')
-rw-r--r-- | src/SMAPI/Framework/ModLoading/AssemblyLoader.cs | 3 | ||||
-rw-r--r-- | src/SMAPI/Framework/ModLoading/Framework/RecursiveRewriter.cs | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs b/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs index eadb2997..dbb5f696 100644 --- a/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs +++ b/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs @@ -4,6 +4,7 @@ using System.IO; using System.Linq; using System.Reflection; using Mono.Cecil; +using Mono.Cecil.Cil; using StardewModdingAPI.Framework.Exceptions; using StardewModdingAPI.Framework.ModLoading.Framework; using StardewModdingAPI.Metadata; @@ -304,7 +305,7 @@ namespace StardewModdingAPI.Framework.ModLoading rewritten |= handler.Handle(module, type, replaceWith); return rewritten; }, - rewriteInstruction: (instruction, cil, replaceWith) => + rewriteInstruction: (ref Instruction instruction, ILProcessor cil, Action<Instruction> replaceWith) => { bool rewritten = false; foreach (IInstructionHandler handler in handlers) diff --git a/src/SMAPI/Framework/ModLoading/Framework/RecursiveRewriter.cs b/src/SMAPI/Framework/ModLoading/Framework/RecursiveRewriter.cs index a0f075bd..c774c038 100644 --- a/src/SMAPI/Framework/ModLoading/Framework/RecursiveRewriter.cs +++ b/src/SMAPI/Framework/ModLoading/Framework/RecursiveRewriter.cs @@ -23,7 +23,7 @@ namespace StardewModdingAPI.Framework.ModLoading.Framework /// <param name="cil">The CIL instruction processor.</param> /// <param name="replaceWith">Replaces the CIL instruction with the given instruction.</param> /// <returns>Returns whether the instruction was changed.</returns> - public delegate bool RewriteInstructionDelegate(Instruction instruction, ILProcessor cil, Action<Instruction> replaceWith); + public delegate bool RewriteInstructionDelegate(ref Instruction instruction, ILProcessor cil, Action<Instruction> replaceWith); /********* @@ -144,7 +144,7 @@ namespace StardewModdingAPI.Framework.ModLoading.Framework // instruction itself // (should be done after the above type rewrites to ensure valid types) - rewritten |= this.RewriteInstructionImpl(instruction, cil, newInstruction => + rewritten |= this.RewriteInstructionImpl(ref instruction, cil, newInstruction => { rewritten = true; cil.Replace(instruction, newInstruction); |