fix another issue with the importer -- it didnt bother to restore the current directory if canceled

This commit is contained in:
Chris Forbes
2011-02-28 22:23:16 +13:00
parent 88436bda45
commit 4b853ca9e8

View File

@@ -359,11 +359,10 @@ namespace OpenRA.Editor
void ImportLegacyMapClicked(object sender, EventArgs e) void ImportLegacyMapClicked(object sender, EventArgs e)
{ {
var currentDirectory = Directory.GetCurrentDirectory(); using (var ofd = new OpenFileDialog { RestoreDirectory = true,
using (var ofd = new OpenFileDialog { Filter = "Legacy maps (*.ini;*.mpr)|*.ini;*.mpr" }) Filter = "Legacy maps (*.ini;*.mpr)|*.ini;*.mpr" })
if (DialogResult.OK == ofd.ShowDialog()) if (DialogResult.OK == ofd.ShowDialog())
{ {
Directory.SetCurrentDirectory(currentDirectory);
/* massive hack: we should be able to call NewMap() with the imported Map object, /* massive hack: we should be able to call NewMap() with the imported Map object,
* but something's not right internally in it, unless loaded via the real maploader */ * but something's not right internally in it, unless loaded via the real maploader */