From be96bafc69679d63ab349602649ecf8e1f2fff5b Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sat, 10 Mar 2018 11:11:44 +0000 Subject: [PATCH] Match missions using the unresolved path. --- .../Widgets/Logic/MissionBrowserLogic.cs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/OpenRA.Mods.Common/Widgets/Logic/MissionBrowserLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/MissionBrowserLogic.cs index f671e3597e..2d5074a13e 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/MissionBrowserLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/MissionBrowserLogic.cs @@ -105,11 +105,18 @@ namespace OpenRA.Mods.Common.Widgets.Logic foreach (var kv in yaml) { - var missionMapPaths = kv.Value.Nodes.Select(n => Path.GetFullPath(n.Key)).ToList(); + var missionMapPaths = kv.Value.Nodes.Select(n => n.Key).ToList(); var previews = modData.MapCache - .Where(p => p.Status == MapStatus.Available && missionMapPaths.Contains(p.Package.Name)) - .OrderBy(p => missionMapPaths.IndexOf(p.Package.Name)); + .Where(p => p.Status == MapStatus.Available) + .Select(p => new + { + Preview = p, + Index = missionMapPaths.IndexOf(Platform.UnresolvePath(p.Package.Name)) + }) + .Where(x => x.Index != -1) + .OrderBy(x => x.Index) + .Select(x => x.Preview); CreateMissionGroup(kv.Key, previews); allPreviews.AddRange(previews);