diff options
Diffstat (limited to 'src/SMAPI/Metadata/InstructionMetadata.cs')
-rw-r--r-- | src/SMAPI/Metadata/InstructionMetadata.cs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/SMAPI/Metadata/InstructionMetadata.cs b/src/SMAPI/Metadata/InstructionMetadata.cs index 9e2b7967..4ed1e38e 100644 --- a/src/SMAPI/Metadata/InstructionMetadata.cs +++ b/src/SMAPI/Metadata/InstructionMetadata.cs @@ -13,6 +13,14 @@ namespace StardewModdingAPI.Metadata internal class InstructionMetadata { /********* + ** Properties + *********/ + /// <summary>The assembly names to which to heuristically detect broken references.</summary> + /// <remarks>The current implementation only works correctly with assemblies that should always be present.</remarks> + private readonly string[] ValidateReferencesToAssemblies = { "StardewModdingAPI", "Stardew Valley", "StardewValley" }; + + + /********* ** Public methods *********/ /// <summary>Get rewriters which detect or fix incompatible CIL instructions in mod assemblies.</summary> @@ -87,8 +95,8 @@ namespace StardewModdingAPI.Metadata new PropertyFinder("StardewModdingAPI.Mod", "PerSaveConfigPath", InstructionHandleResult.NotCompatible), // broken code - new ReferenceToMissingMemberFinder(), - new ReferenceToMemberWithUnexpectedTypeFinder(), + new ReferenceToMissingMemberFinder(this.ValidateReferencesToAssemblies), + new ReferenceToMemberWithUnexpectedTypeFinder(this.ValidateReferencesToAssemblies), /**** ** detect code which may impact game stability |