diff --git a/OpenRA.Editor/Program.cs b/OpenRA.Editor/Program.cs index a6888c8d54..0b9542c3d5 100644 --- a/OpenRA.Editor/Program.cs +++ b/OpenRA.Editor/Program.cs @@ -22,38 +22,11 @@ namespace OpenRA.Editor [STAThread] static void Main(string[] args) { - if (args.Length >= 2 && args[0] == "--convert") - { - Game.modData = new ModData(args[1]); - FileSystem.LoadFromManifest(Game.modData.Manifest); - Rules.LoadRules(Game.modData.Manifest, new Map()); - UpgradeMaps(args[1]); - return; - } - Application.CurrentCulture = CultureInfo.InvariantCulture; Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1(args)); } - - static void UpgradeMaps(string mod) - { - var mapFolderPath = new string[] { Environment.CurrentDirectory, "mods", mod, "maps" } - .Aggregate(Path.Combine); - - foreach (var path in ModData.FindMapsIn(mapFolderPath)) - { - var map = new Map(path); - - // Touch the lazy bits to initialize them - map.Actors.Force(); - map.Smudges.Force(); - map.MapTiles.Force(); - map.MapResources.Force(); - map.Save(path); - } - } } } diff --git a/OpenRA.Utility/Command.cs b/OpenRA.Utility/Command.cs index 50f91826fd..222b04fa89 100644 --- a/OpenRA.Utility/Command.cs +++ b/OpenRA.Utility/Command.cs @@ -312,5 +312,13 @@ namespace OpenRA.Utility minimap.Save(dest); Console.WriteLine(dest + " saved."); } + + public static void UpgradeMap(string[] args) + { + var map = args[1]; + var mod = args[2]; + Game.modData = new ModData(mod); + new Map(map, mod); + } } } diff --git a/OpenRA.Utility/Program.cs b/OpenRA.Utility/Program.cs index 6cac4f4067..3c395c46e5 100644 --- a/OpenRA.Utility/Program.cs +++ b/OpenRA.Utility/Program.cs @@ -29,6 +29,7 @@ namespace OpenRA.Utility { "--docs", Command.ExtractTraitDocs }, { "--map-hash", Command.GetMapHash }, { "--minimap", Command.GenerateMinimap }, + { "--map-upgrade", Command.UpgradeMap }, }; if (args.Length == 0) { PrintUsage(); return; }