summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2018-12-07 13:40:44 -0500
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2018-12-07 13:40:44 -0500
commita78b1935928919694dfe8de823a1accd6d222732 (patch)
tree3f17b6087cf2749e52c1e237de17e2e9addb6c06 /src/SMAPI/Framework/ModLoading/AssemblyLoader.cs
parent4cd9eda1591c3908bf80b60c2902491a7595ee27 (diff)
parent8901218418693d610a17b22fe789ba6279f63446 (diff)
downloadSMAPI-a78b1935928919694dfe8de823a1accd6d222732.tar.gz
SMAPI-a78b1935928919694dfe8de823a1accd6d222732.tar.bz2
SMAPI-a78b1935928919694dfe8de823a1accd6d222732.zip
Merge branch 'develop' into stable
Diffstat (limited to 'src/SMAPI/Framework/ModLoading/AssemblyLoader.cs')
-rw-r--r--src/SMAPI/Framework/ModLoading/AssemblyLoader.cs9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs b/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs
index fdbfdd8d..7292cf3f 100644
--- a/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs
+++ b/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs
@@ -20,6 +20,9 @@ namespace StardewModdingAPI.Framework.ModLoading
/// <summary>Encapsulates monitoring and logging.</summary>
private readonly IMonitor Monitor;
+ /// <summary>Whether to detect paranoid mode issues.</summary>
+ private readonly bool ParanoidMode;
+
/// <summary>Metadata for mapping assemblies to the current platform.</summary>
private readonly PlatformAssemblyMap AssemblyMap;
@@ -39,9 +42,11 @@ namespace StardewModdingAPI.Framework.ModLoading
/// <summary>Construct an instance.</summary>
/// <param name="targetPlatform">The current game platform.</param>
/// <param name="monitor">Encapsulates monitoring and logging.</param>
- public AssemblyLoader(Platform targetPlatform, IMonitor monitor)
+ /// <param name="paranoidMode">Whether to detect paranoid mode issues.</param>
+ public AssemblyLoader(Platform targetPlatform, IMonitor monitor, bool paranoidMode)
{
this.Monitor = monitor;
+ this.ParanoidMode = paranoidMode;
this.AssemblyMap = this.TrackForDisposal(Constants.GetAssemblyMap(targetPlatform));
this.AssemblyDefinitionResolver = this.TrackForDisposal(new AssemblyDefinitionResolver());
this.AssemblyDefinitionResolver.AddSearchDirectory(Constants.ExecutionPath);
@@ -275,7 +280,7 @@ namespace StardewModdingAPI.Framework.ModLoading
// find (and optionally rewrite) incompatible instructions
bool anyRewritten = false;
- IInstructionHandler[] handlers = new InstructionMetadata().GetHandlers().ToArray();
+ IInstructionHandler[] handlers = new InstructionMetadata().GetHandlers(this.ParanoidMode).ToArray();
foreach (MethodDefinition method in this.GetMethods(module))
{
// check method definition