summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2023-04-02 15:39:46 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2023-04-02 15:39:46 -0400
commitd13046edb6db5f87b215f6f3830c2a1c1933dbee (patch)
treeb495f123023db5623d329e44489fc5db039fae70
parent45903dbf3e36058958fce274c79a0a77e7052cb9 (diff)
parentc12e9d788e71aaee155a4a055c08ccb88f0e8c21 (diff)
downloadSMAPI-d13046edb6db5f87b215f6f3830c2a1c1933dbee.tar.gz
SMAPI-d13046edb6db5f87b215f6f3830c2a1c1933dbee.tar.bz2
SMAPI-d13046edb6db5f87b215f6f3830c2a1c1933dbee.zip
Merge pull request #901 from atravita-mods/develop
Avoid resolving empty folders
-rw-r--r--src/SMAPI/Framework/ModLoading/ModResolver.cs5
-rw-r--r--src/SMAPI/Framework/SCore.cs2
2 files changed, 5 insertions, 2 deletions
diff --git a/src/SMAPI/Framework/ModLoading/ModResolver.cs b/src/SMAPI/Framework/ModLoading/ModResolver.cs
index cb62e16f..37aceb1b 100644
--- a/src/SMAPI/Framework/ModLoading/ModResolver.cs
+++ b/src/SMAPI/Framework/ModLoading/ModResolver.cs
@@ -180,7 +180,10 @@ namespace StardewModdingAPI.Framework.ModLoading
return mods
.OrderBy(mod =>
{
- string id = mod.Manifest.UniqueID;
+ string? id = mod.Manifest?.UniqueID;
+
+ if (id is null)
+ return 0;
if (modIdsToLoadEarly.TryGetValue(id, out string? actualId))
return -int.MaxValue + Array.IndexOf(earlyArray, actualId);
diff --git a/src/SMAPI/Framework/SCore.cs b/src/SMAPI/Framework/SCore.cs
index 1d146d5f..37ca1556 100644
--- a/src/SMAPI/Framework/SCore.cs
+++ b/src/SMAPI/Framework/SCore.cs
@@ -433,7 +433,7 @@ namespace StardewModdingAPI.Framework
// apply load order customizations
if (this.Settings.ModsToLoadEarly.Any() || this.Settings.ModsToLoadLate.Any())
{
- HashSet<string> installedIds = new HashSet<string>(mods.Select(p => p.Manifest.UniqueID), StringComparer.OrdinalIgnoreCase);
+ HashSet<string> installedIds = new HashSet<string>(mods.Where(p => p.FailReason is null).Select(p => p.Manifest.UniqueID), StringComparer.OrdinalIgnoreCase);
string[] missingEarlyMods = this.Settings.ModsToLoadEarly.Where(id => !installedIds.Contains(id)).OrderBy(p => p, StringComparer.OrdinalIgnoreCase).ToArray();
string[] missingLateMods = this.Settings.ModsToLoadLate.Where(id => !installedIds.Contains(id)).OrderBy(p => p, StringComparer.OrdinalIgnoreCase).ToArray();