diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2020-05-09 20:45:45 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2020-05-09 20:45:45 -0400 |
commit | 1ff09685906b03b46b23e69b7bfe95df24c8184f (patch) | |
tree | 4e77c9aa52b0aa32bc764a0c377953dc2f24b5ad /src/SMAPI/Framework/ModLoading/AssemblyLoader.cs | |
parent | 19397a89ff6f0d216637e1272b78c7e15c85bf76 (diff) | |
download | SMAPI-1ff09685906b03b46b23e69b7bfe95df24c8184f.tar.gz SMAPI-1ff09685906b03b46b23e69b7bfe95df24c8184f.tar.bz2 SMAPI-1ff09685906b03b46b23e69b7bfe95df24c8184f.zip |
fixed generic types in method references not rewritten (#711)
Diffstat (limited to 'src/SMAPI/Framework/ModLoading/AssemblyLoader.cs')
-rw-r--r-- | src/SMAPI/Framework/ModLoading/AssemblyLoader.cs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs b/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs index 5b5a621b..570686fe 100644 --- a/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs +++ b/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs @@ -314,13 +314,19 @@ namespace StardewModdingAPI.Framework.ModLoading // ReSharper disable once ForCanBeConvertedToForeach -- deliberate access by index so each handler sees replacements from previous handlers for (int offset = 0; offset < instructions.Count; offset++) { + Instruction instruction = instructions[offset]; + if (instruction.OpCode.Code == Code.Nop) + continue; + foreach (IInstructionHandler handler in handlers) { - Instruction instruction = instructions[offset]; InstructionHandleResult result = handler.Handle(module, cil, instruction, this.AssemblyMap, platformChanged); this.ProcessInstructionHandleResult(mod, handler, result, loggedMessages, logPrefix, filename); if (result == InstructionHandleResult.Rewritten) + { + instruction = instructions[offset]; anyRewritten = true; + } } } } |