fix mods which implement IAssetLoader being marked as conflicting with themselves

This commit is contained in:
Jesse Plamondon-Willard 2017-10-21 21:51:48 -04:00
parent 53df85f312
commit 85a8959e97
2 changed files with 3 additions and 6 deletions

View File

@ -6,6 +6,7 @@
* For modders:
* The reflection API now works with public code to simplify mod integrations.
* Fixed `e.SuppressButton()` in input events not correctly suppressing keyboard buttons.
* Fixed mods which implement `IAssetLoader` directly not being allowed to load files due to incorrect conflict detection.
## 2.0
### Release highlights

View File

@ -510,16 +510,12 @@ namespace StardewModdingAPI.Framework
{
foreach (var entry in entries)
{
IModMetadata metadata = entry.Key;
IModMetadata mod = entry.Key;
IList<T> interceptors = entry.Value;
// special case if mod is an interceptor
if (metadata.Mod is T modAsInterceptor)
yield return new KeyValuePair<IModMetadata, T>(metadata, modAsInterceptor);
// registered editors
foreach (T interceptor in interceptors)
yield return new KeyValuePair<IModMetadata, T>(metadata, interceptor);
yield return new KeyValuePair<IModMetadata, T>(mod, interceptor);
}
}