diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2018-03-05 19:07:22 -0500 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2018-03-05 19:07:22 -0500 |
commit | 8689fe65642d07fa6a2513aa36c1389479e50d0c (patch) | |
tree | 65e2055edc73c354b1995bcae96c5339fbd61e5c /src/SMAPI/Metadata | |
parent | 1fbd41ecb2141d769072c71822fb02876401a592 (diff) | |
download | SMAPI-8689fe65642d07fa6a2513aa36c1389479e50d0c.tar.gz SMAPI-8689fe65642d07fa6a2513aa36c1389479e50d0c.tar.bz2 SMAPI-8689fe65642d07fa6a2513aa36c1389479e50d0c.zip |
fix compatibility heuristics incorrectly flagging mods with missing optional references (#453)
Diffstat (limited to 'src/SMAPI/Metadata')
-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 |