Skip to content

Commit

Permalink
Fix eval of multiple FIOS\LIOS
Browse files Browse the repository at this point in the history
  • Loading branch information
bcssov committed Jan 20, 2025
1 parent 8fb88f3 commit 0460ade
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/IronyModManager.Services/ModBaseService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Created : 04-07-2020
//
// Last Modified By : Mario
// Last Modified On : 03-04-2024
// Last Modified On : 01-20-2025
// ***********************************************************************
// <copyright file="ModBaseService.cs" company="Mario">
// Mario
Expand Down Expand Up @@ -382,7 +382,7 @@ protected virtual IPriorityDefinitionResult EvalDefinitionPriorityInternal(IEnum
// Using FIOS or LIOS?
case > 1 when isFios:
{
var ordered = uniqueDefinitions.OrderBy(p => Path.GetFileNameWithoutExtension(p.FileName), StringComparer.Ordinal);
var ordered = uniqueDefinitions.GroupBy(p => p.FileName).Select(p => p.LastOrDefault()).OrderBy(p => Path.GetFileNameWithoutExtension(p?.FileName), StringComparer.Ordinal);
var definition = ordered.First();
result.Definition = definition.Definition;
result.FileName = definition.FileName;
Expand All @@ -392,7 +392,7 @@ protected virtual IPriorityDefinitionResult EvalDefinitionPriorityInternal(IEnum
}
case > 1:
{
var ordered = uniqueDefinitions.OrderBy(p => Path.GetFileNameWithoutExtension(p.FileName), StringComparer.Ordinal);
var ordered = uniqueDefinitions.GroupBy(p => p.FileName).Select(p => p.LastOrDefault()).OrderBy(p => Path.GetFileNameWithoutExtension(p?.FileName), StringComparer.Ordinal);
var definition = ordered.Last();
result.Definition = definition.Definition;
result.FileName = definition.FileName;
Expand Down Expand Up @@ -581,8 +581,7 @@ protected virtual IEnumerable<IMod> GetInstalledModsInternal(string game, bool i
/// <param name="game">The game.</param>
/// <param name="ignorePatchMods">if set to <c>true</c> [ignore patch mods].</param>
/// <returns>IEnumerable&lt;IMod&gt;.</returns>
/// <exception cref="ArgumentNullException">nameof(game)</exception>
/// <exception cref="System.ArgumentNullException">game</exception>
/// <exception cref="System.ArgumentNullException"></exception>
protected virtual IEnumerable<IMod> GetInstalledModsInternal(IGame game, bool ignorePatchMods)
{
ArgumentNullException.ThrowIfNull(game);
Expand Down

0 comments on commit 0460ade

Please sign in to comment.