diff --git a/Source/Core/General/General.cs b/Source/Core/General/General.cs index 4ad59aeb..deedcbc7 100644 --- a/Source/Core/General/General.cs +++ b/Source/Core/General/General.cs @@ -1110,13 +1110,11 @@ namespace CodeImp.DoomBuilder [BeginAction("openmap")] internal static void OpenMap() { - OpenFileDialog openfile; - // Cancel volatile mode, if any General.Editing.DisengageVolatileMode(); // Open map file dialog - openfile = new OpenFileDialog(); + OpenFileDialog openfile = new OpenFileDialog(); openfile.Filter = "Doom WAD Files (*.wad)|*.wad"; openfile.Title = "Open Map"; openfile.AddExtension = false; @@ -1207,8 +1205,6 @@ namespace CodeImp.DoomBuilder // This opens the specified file internal static void OpenMapFile(string filename, MapOptions options) { - OpenMapOptionsForm openmapwindow; - // Cancel volatile mode, if any General.Editing.DisengageVolatileMode(); @@ -1216,10 +1212,7 @@ namespace CodeImp.DoomBuilder if(General.AskSaveMap()) { // Open map options dialog - if(options != null) - openmapwindow = new OpenMapOptionsForm(filename, options); - else - openmapwindow = new OpenMapOptionsForm(filename); + OpenMapOptionsForm openmapwindow = (options != null ? new OpenMapOptionsForm(filename, options) : new OpenMapOptionsForm(filename)); if(openmapwindow.ShowDialog(mainwindow) == DialogResult.OK) OpenMapFileWithOptions(filename, openmapwindow.Options); diff --git a/Source/Core/Windows/MainForm.cs b/Source/Core/Windows/MainForm.cs index 99a81cb9..8ba410fe 100644 --- a/Source/Core/Windows/MainForm.cs +++ b/Source/Core/Windows/MainForm.cs @@ -449,11 +449,12 @@ namespace CodeImp.DoomBuilder.Windows { bool showdialog = false; MapOptions options = new MapOptions(); - Configuration mapsettings; // Any of the options already given? if(General.AutoLoadMap != null) { + Configuration mapsettings; + // Try to find existing options in the settings file string dbsfile = General.AutoLoadFile.Substring(0, General.AutoLoadFile.Length - 4) + ".dbs"; if(File.Exists(dbsfile)) @@ -486,7 +487,7 @@ namespace CodeImp.DoomBuilder.Windows if(showdialog) { // Show open dialog - General.OpenMapFile(General.AutoLoadFile, options); + General.OpenMapFile(General.AutoLoadFile, null); } else {