Fix map importer using the map title as the output filename.

This is broken because the map title can make an invalid filename.
This commit is contained in:
ScottNZ
2015-02-08 12:55:45 +13:00
parent 32243122be
commit 61de2a2312

View File

@@ -9,9 +9,7 @@
#endregion #endregion
using System; using System;
using System.Collections.Generic; using System.IO;
using System.Linq;
using System.Text;
namespace OpenRA.Mods.Common.UtilityCommands namespace OpenRA.Mods.Common.UtilityCommands
{ {
@@ -27,7 +25,7 @@ namespace OpenRA.Mods.Common.UtilityCommands
var rules = Game.ModData.RulesetCache.LoadDefaultRules(); var rules = Game.ModData.RulesetCache.LoadDefaultRules();
var map = LegacyMapImporter.Import(args[1], modData.Manifest.Mod.Id, rules, e => Console.WriteLine(e)); var map = LegacyMapImporter.Import(args[1], modData.Manifest.Mod.Id, rules, e => Console.WriteLine(e));
var dest = map.Title + ".oramap"; var dest = Path.ChangeExtension(args[1], "oramap");
map.Save(dest); map.Save(dest);
Console.WriteLine(dest + " saved."); Console.WriteLine(dest + " saved.");
} }