diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2021-08-08 00:24:20 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2021-08-08 00:24:20 -0400 |
commit | 976c66537c9f4493ce859c574675bb8651b5323f (patch) | |
tree | 1e16747a1f78e10baf68171140d9bb06f20aeb72 /src/SMAPI/Constants.cs | |
parent | 885808fb66233caf3057f0baa6368f4763a8eade (diff) | |
download | SMAPI-976c66537c9f4493ce859c574675bb8651b5323f.tar.gz SMAPI-976c66537c9f4493ce859c574675bb8651b5323f.tar.bz2 SMAPI-976c66537c9f4493ce859c574675bb8651b5323f.zip |
fix edge case where Netcode references aren't rewritten correctly
Diffstat (limited to 'src/SMAPI/Constants.cs')
-rw-r--r-- | src/SMAPI/Constants.cs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/SMAPI/Constants.cs b/src/SMAPI/Constants.cs index 7f633a46..de6b63d6 100644 --- a/src/SMAPI/Constants.cs +++ b/src/SMAPI/Constants.cs @@ -243,6 +243,17 @@ namespace StardewModdingAPI // case involving unofficial 64-bit Stardew Valley when launched through Steam (for some players only) // where Mono.Cecil can't resolve references to SMAPI. resolver.Add(AssemblyDefinition.ReadAssembly(typeof(SGame).Assembly.Location)); + + // make sure game assembly names can be resolved + // The game assembly can have one of three names depending how the mod was compiled: + // - 'StardewValley': assembly name on Linux/macOS; + // - 'Stardew Valley': assembly name on Windows; + // - 'Netcode': an assembly that's separate on Windows only. + resolver.Add(AssemblyDefinition.ReadAssembly(typeof(Game1).Assembly.Location), "StardewValley", "Stardew Valley" +#if !SMAPI_FOR_WINDOWS + , "Netcode" +#endif + ); } /// <summary>Get metadata for mapping assemblies to the current platform.</summary> |