From 9025b0dcc5c537cbde37aef2482ccd942eb9769f Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Fri, 25 Mar 2022 22:16:49 -0400 Subject: [PATCH] fix asset load conflict always showing multiple-mod form --- docs/release-notes.md | 1 + src/SMAPI/Framework/ContentManagers/GameContentManager.cs | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/release-notes.md b/docs/release-notes.md index 2a8d142f..7cdd093a 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -9,6 +9,7 @@ * Improved [command-line arguments](technical/smapi.md#command-line-arguments) on Linux/macOS: * Added `--use-current-shell` to avoid opening a separate terminal window. * Fixed `--no-terminal` still opening a terminal window, even if nothing is logged to it (thanks to Ryhon0!). + * Fixed warning text when a mod causes an asset load conflict with itself. * For mod authors: * Added [content events](https://stardewvalleywiki.com/Modding:Modder_Guide/APIs/Events#Content), which will replace `IAssetEditor` and `IAssetLoader` in SMAPI 4.0.0. These include new features not supported by the old API like content pack labels. diff --git a/src/SMAPI/Framework/ContentManagers/GameContentManager.cs b/src/SMAPI/Framework/ContentManagers/GameContentManager.cs index 58e36128..8bdb39d0 100644 --- a/src/SMAPI/Framework/ContentManagers/GameContentManager.cs +++ b/src/SMAPI/Framework/ContentManagers/GameContentManager.cs @@ -400,7 +400,10 @@ namespace StardewModdingAPI.Framework.ContentManagers return true; } - string[] loaderNames = loaders.Select(p => p.Mod.DisplayName).ToArray(); + string[] loaderNames = loaders + .Select(p => p.Mod.DisplayName) + .Distinct() + .ToArray(); string errorPhrase = loaderNames.Length > 1 ? $"Multiple mods want to provide '{info.Name}' asset ({string.Join(", ", loaderNames)})" : $"The '{loaderNames[0]}' mod wants to provide the '{info.Name}' asset multiple times";