From b3713489d38bafc7ab3d85964f8b06e354eaba57 Mon Sep 17 00:00:00 2001 From: MaxED <j.maxed@gmail.com> Date: Fri, 26 Jul 2013 09:36:32 +0000 Subject: [PATCH] Fixed a compilation error in MapManager.cs when building solution in Release mode. --- Source/Core/General/MapManager.cs | 39 +++++++++++++++---------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/Source/Core/General/MapManager.cs b/Source/Core/General/MapManager.cs index f0d8bd85a..610c21012 100644 --- a/Source/Core/General/MapManager.cs +++ b/Source/Core/General/MapManager.cs @@ -453,6 +453,7 @@ namespace CodeImp.DoomBuilder { // Create map data MapSet newmap = new MapSet(); + WAD mapwad; // Create temp wadfile string tempfile = General.MakeTempFilename(temppath); @@ -462,25 +463,24 @@ namespace CodeImp.DoomBuilder { #if DEBUG tempwad = new WAD(tempfile); #else - try { tempwad = new WAD(tempfile); } - catch(Exception e) - { - General.ShowErrorMessage("Error while creating a temporary wad file:\n" + e.GetType().Name + ": " + e.Message, MessageBoxButtons.OK); - return false; - } + try { tempwad = new WAD(tempfile); } catch(Exception e) + { + General.ShowErrorMessage("Error while creating a temporary wad file:\n" + e.GetType().Name + ": " + e.Message, MessageBoxButtons.OK); + return false; + } #endif // Now open the map file General.WriteLogLine("Opening source file: " + filepathname); + #if DEBUG - WAD mapwad = new WAD(filepathname, true); + mapwad = new WAD(filepathname, true); #else - try { mapwad = new WAD(filepathname, true); } - catch(Exception e) - { - General.ShowErrorMessage("Error while opening source wad file:\n" + e.GetType().Name + ": " + e.Message, MessageBoxButtons.OK); - return false; - } + try { mapwad = new WAD(filepathname, true); } catch(Exception e) + { + General.ShowErrorMessage("Error while opening source wad file:\n" + e.GetType().Name + ": " + e.Message, MessageBoxButtons.OK); + return false; + } #endif // Copy the map lumps to the temp file @@ -498,13 +498,12 @@ namespace CodeImp.DoomBuilder { #if DEBUG newmap = io.Read(newmap, TEMP_MAP_HEADER); #else - try { newmap = io.Read(newmap, TEMP_MAP_HEADER); } - catch(Exception e) - { - General.ErrorLogger.Add(ErrorType.Error, "Unable to read the map data structures with the specified configuration. " + e.GetType().Name + ": " + e.Message); - General.ShowErrorMessage("Unable to read the map data structures with the specified configuration.", MessageBoxButtons.OK); - return false; - } + try { newmap = io.Read(newmap, TEMP_MAP_HEADER); } catch(Exception e) + { + General.ErrorLogger.Add(ErrorType.Error, "Unable to read the map data structures with the specified configuration. " + e.GetType().Name + ": " + e.Message); + General.ShowErrorMessage("Unable to read the map data structures with the specified configuration.", MessageBoxButtons.OK); + return false; + } #endif newmap.EndAddRemove(); -- GitLab