From 6b0d13be7c8383785cc3152d502959b15468b234 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Tue, 3 Aug 2021 19:03:51 -0400 Subject: fix Mono.Cecil failing to resolve references to SMAPI in some edge cases --- src/SMAPI/Framework/ModLoading/AssemblyLoader.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'src/SMAPI/Framework/ModLoading/AssemblyLoader.cs') diff --git a/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs b/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs index 3606eb66..2b71038a 100644 --- a/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs +++ b/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs @@ -61,6 +61,7 @@ namespace StardewModdingAPI.Framework.ModLoading this.AssemblyDefinitionResolver = this.TrackForDisposal(new AssemblyDefinitionResolver()); this.AssemblyDefinitionResolver.AddSearchDirectory(Constants.ExecutionPath); this.AssemblyDefinitionResolver.AddSearchDirectory(Constants.InternalFilesPath); + this.AssemblyDefinitionResolver.Add(AssemblyDefinition.ReadAssembly(typeof(SGame).Assembly.Location)); // for some reason Mono.Cecil can't resolve SMAPI in very specific cases involving unofficial 64-bit Stardew Valley when launched through Steam (for some players only) // generate type => assembly lookup for types which should be rewritten this.TypeAssemblies = new Dictionary(); -- cgit