diff --git a/Source/Core/IO/WAD.cs b/Source/Core/IO/WAD.cs index 540a3e5..ac5907d 100644 --- a/Source/Core/IO/WAD.cs +++ b/Source/Core/IO/WAD.cs @@ -32,6 +32,7 @@ namespace CodeImp.DoomBuilder.IO // WAD types public const string TYPE_IWAD = "IWAD"; public const string TYPE_PWAD = "PWAD"; + public const string TYPE_ZWAD = "ZWAD"; // Encoder public static readonly Encoding ENCODING = Encoding.ASCII; @@ -194,6 +195,9 @@ namespace CodeImp.DoomBuilder.IO // Read WAD type type = ENCODING.GetString(reader.ReadBytes(4)); + + if (type == TYPE_ZWAD) + throw new IOException("Sorry, can't open ZWADs. Please decompress first."); // Number of lumps numlumps = reader.ReadInt32(); diff --git a/Source/Core/Windows/ChangeMapForm.cs b/Source/Core/Windows/ChangeMapForm.cs index 192b13f..522c4b6 100644 --- a/Source/Core/Windows/ChangeMapForm.cs +++ b/Source/Core/Windows/ChangeMapForm.cs @@ -45,11 +45,11 @@ namespace CodeImp.DoomBuilder.Windows // Open the WAD file wadfile = new WAD(filepathname, true); } - catch(Exception) + catch(Exception e) { - // Unable to open WAD file (or its config) - MessageBox.Show(this, "Could not open the WAD file for reading. Please make sure the file you selected is valid and is not in use by any other application.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error); - this.DialogResult = DialogResult.Cancel; + // Unable to open WAD file (or its config) + MessageBox.Show(this, "Could not open the WAD file for reading.\n" + e.GetType().Name + ": " + e.Message + "\nPlease make sure the file you selected is valid and is not in use by any other application.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error); + this.DialogResult = DialogResult.Cancel; this.Close(); return; } diff --git a/Source/Core/Windows/OpenMapOptionsForm.cs b/Source/Core/Windows/OpenMapOptionsForm.cs index 7960737..cfcfe6f 100644 --- a/Source/Core/Windows/OpenMapOptionsForm.cs +++ b/Source/Core/Windows/OpenMapOptionsForm.cs @@ -90,10 +90,10 @@ namespace CodeImp.DoomBuilder.Windows // Open the WAD file wadfile = new WAD(filepathname, true); } - catch(Exception) + catch(Exception e) { - // Unable to open WAD file (or its config) - MessageBox.Show(this, "Could not open the WAD file for reading. Please make sure the file you selected is valid and is not in use by any other application.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error); + // Unable to open WAD file (or its config) + MessageBox.Show(this, "Could not open the WAD file for reading.\n" + e.GetType().Name + ": " + e.Message + "\nPlease make sure the file you selected is valid and is not in use by any other application.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error); if(wadfile != null) wadfile.Dispose(); this.DialogResult = DialogResult.Cancel; this.Close();