diff --git a/CHANGELOG.md b/CHANGELOG.md index 91dc8a1121..3cd8252937 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ All notable changes to this project will be documented in this file. - [Multiple] Show DLC in recommendations list (#3038 by: HebaruSan; reviewed: DasSkelett) - [Multiple] Prompt user to overwrite manually installed files (#3043 by: HebaruSan; reviewed: DasSkelett) - [GUI] Master search bar and misc GUI clean-up (#3041 by: HebaruSan; reviewed: DasSkelett) +- [Core] Don't try to install multiple versions of the same mod (#3051 by: HebaruSan; reviewed: DasSkelett) ### Bugfixes diff --git a/Core/Relationships/RelationshipResolver.cs b/Core/Relationships/RelationshipResolver.cs index ed66724b32..04cdb6e851 100644 --- a/Core/Relationships/RelationshipResolver.cs +++ b/Core/Relationships/RelationshipResolver.cs @@ -410,7 +410,9 @@ private void ResolveStanza(IEnumerable stanza, Selection var descriptor1 = descriptor; List candidates = descriptor .LatestAvailableWithProvides(registry, kspversion, modlist.Values) - .Where(mod => descriptor1.WithinBounds(mod) && MightBeInstallable(mod)) + .Where(mod => !modlist.ContainsKey(mod.identifier) + && descriptor1.WithinBounds(mod) + && MightBeInstallable(mod)) .ToList(); if (candidates.Count == 0) { @@ -418,7 +420,9 @@ private void ResolveStanza(IEnumerable stanza, Selection // (conflicts will still be caught below) candidates = descriptor .LatestAvailableWithProvides(registry, kspversion) - .Where(mod => descriptor1.WithinBounds(mod) && MightBeInstallable(mod)) + .Where(mod => !modlist.ContainsKey(mod.identifier) + && descriptor1.WithinBounds(mod) + && MightBeInstallable(mod)) .ToList(); } @@ -519,7 +523,7 @@ private void Add(CkanModule module, SelectionReason reason) { // We should never be adding something twice! log.ErrorFormat("Assertion failed: Adding {0} twice in relationship resolution", module.identifier); - throw new ArgumentException("Already contains module:" + module.identifier); + throw new ArgumentException("Already contains module: " + module.identifier); } modlist.Add(module.identifier, module); if (!reasons.ContainsKey(module))