summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2017-08-23 16:13:28 -0400
committerJesse Plamondon-Willard <github@jplamondonw.com>2017-08-23 16:13:28 -0400
commite93d58f69b62a82922e311dfdd5c209b63d419e7 (patch)
tree58d5f34a63c38c5f281d40a565ae351b3fea0e7f
parent8ba54a682fd7de3756b6ddd262b232cf40d23ea0 (diff)
downloadSMAPI-e93d58f69b62a82922e311dfdd5c209b63d419e7.tar.gz
SMAPI-e93d58f69b62a82922e311dfdd5c209b63d419e7.tar.bz2
SMAPI-e93d58f69b62a82922e311dfdd5c209b63d419e7.zip
fix incorrect 'mod already loaded' errors in some cases
-rw-r--r--src/StardewModdingAPI/Framework/ModLoading/AssemblyLoader.cs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/StardewModdingAPI/Framework/ModLoading/AssemblyLoader.cs b/src/StardewModdingAPI/Framework/ModLoading/AssemblyLoader.cs
index b14ae56f..e6ec21a6 100644
--- a/src/StardewModdingAPI/Framework/ModLoading/AssemblyLoader.cs
+++ b/src/StardewModdingAPI/Framework/ModLoading/AssemblyLoader.cs
@@ -76,7 +76,7 @@ namespace StardewModdingAPI.Framework.ModLoading
: $"Could not load '{assemblyPath}'."
);
}
- if (assemblies[0].Status == AssemblyLoadStatus.AlreadyLoaded)
+ if (assemblies.Last().Status == AssemblyLoadStatus.AlreadyLoaded) // mod assembly is last in dependency order
throw new SAssemblyLoadFailedException($"Could not load '{assemblyPath}' because it was already loaded. Do you have two copies of this mod?");
// rewrite & load assemblies in leaf-to-root order