From 8cf084fc418f4bb6a2f0d3828ef91270ad3f1461 Mon Sep 17 00:00:00 2001 From: MaxED Date: Wed, 18 Mar 2015 18:49:46 +0000 Subject: [PATCH] Fixed, Open Map Option window: a warning message is now displayed when the editor fails to find any maps in the wad being open. Fixed, Open Map Option window: fixed a crash when switching to a map configuration with long texture names support enabled when the wad being open has no maps (this will probably never happen because of previous change, but let's be on the safe side...). --- Source/Core/Windows/OpenMapOptionsForm.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Source/Core/Windows/OpenMapOptionsForm.cs b/Source/Core/Windows/OpenMapOptionsForm.cs index ec4d1bea..b4a32b98 100644 --- a/Source/Core/Windows/OpenMapOptionsForm.cs +++ b/Source/Core/Windows/OpenMapOptionsForm.cs @@ -180,6 +180,14 @@ namespace CodeImp.DoomBuilder.Windows } } + //mxd. Bail out if still no dice... + if(config.SelectedIndex == -1) + { + this.Visible = false; + General.ShowWarningMessage("Unable to find maps using any game configuration.\nDoes this wad contain any maps at all?..", MessageBoxButtons.OK); + cancel_Click(this, EventArgs.Empty); + } + // Done Cursor.Current = Cursors.Default; } @@ -353,7 +361,7 @@ namespace CodeImp.DoomBuilder.Windows // Update long texture names checkbox (mxd) longtexturenames.Enabled = cfg.ReadSetting("longtexturenames", false); - longtexturenames.Checked = longtexturenames.Enabled && options.UseLongTextureNames; + longtexturenames.Checked = (longtexturenames.Enabled && options != null && options.UseLongTextureNames); } // OK clicked