From b27cf8ea94ef737bb908f4c2a63c0d8aea36b33d Mon Sep 17 00:00:00 2001 From: Pavel Penev Date: Tue, 29 Sep 2015 23:03:56 +0300 Subject: [PATCH] Small refactoring in Manifest.cs --- OpenRA.Game/Manifest.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/OpenRA.Game/Manifest.cs b/OpenRA.Game/Manifest.cs index ee962e4e82..83429a3e2a 100644 --- a/OpenRA.Game/Manifest.cs +++ b/OpenRA.Game/Manifest.cs @@ -29,7 +29,7 @@ namespace OpenRA } } - // Describes what is to be loaded in order to run a mod + /// Describes what is to be loaded in order to run a mod. public class Manifest { public static readonly Dictionary AllMods = LoadMods(); @@ -106,12 +106,10 @@ namespace OpenRA RequiresMods = yaml["RequiresMods"].ToDictionary(my => my.Value); // Allow inherited mods to import parent maps. - var compat = new List(); - compat.Add(mod); + var compat = new List { Mod.Id }; if (yaml.ContainsKey("SupportsMapsFrom")) - foreach (var c in yaml["SupportsMapsFrom"].Value.Split(',')) - compat.Add(c.Trim()); + compat.AddRange(yaml["SupportsMapsFrom"].Value.Split(',').Select(c => c.Trim())); MapCompatibility = compat.ToArray(); @@ -198,6 +196,7 @@ namespace OpenRA static Dictionary LoadMods() { + // Get mods that are in the game folder. var basePath = Platform.ResolvePath(".", "mods"); var mods = Directory.GetDirectories(basePath) .Select(x => x.Substring(basePath.Length + 1));