Skip to content

Commit

Permalink
Merge pull request #10492 from pchote/fix-mission-order
Browse files Browse the repository at this point in the history
Sort missions by their order in missions.yaml
  • Loading branch information
abcdefg30 committed Jan 16, 2016
2 parents aa23928 + 260681d commit 2ccf142
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions OpenRA.Mods.Common/Widgets/Logic/MissionBrowserLogic.cs
Expand Up @@ -103,11 +103,12 @@ public MissionBrowserLogic(Widget widget, World world, Action onStart, Action on
var yaml = MiniYaml.ApplyRemovals(partial);
foreach (var kv in yaml)
{
var missionMapPaths = kv.Value.Nodes.Select(n => Path.GetFullPath(n.Key));
var missionMapPaths = kv.Value.Nodes.Select(n => Path.GetFullPath(n.Key)).ToList();

var maps = Game.ModData.MapCache
.Where(p => p.Status == MapStatus.Available && missionMapPaths.Contains(Path.GetFullPath(p.Map.Path)))
.Select(p => p.Map);
.Select(p => p.Map)
.OrderBy(m => missionMapPaths.IndexOf(Path.GetFullPath(m.Path)));

CreateMissionGroup(kv.Key, maps);
allMaps.AddRange(maps);
Expand Down

0 comments on commit 2ccf142

Please sign in to comment.