diff --git a/Source/Plugins/VisplaneExplorer/VisplaneExplorerMode.cs b/Source/Plugins/VisplaneExplorer/VisplaneExplorerMode.cs index 76c320db..707165d9 100755 --- a/Source/Plugins/VisplaneExplorer/VisplaneExplorerMode.cs +++ b/Source/Plugins/VisplaneExplorer/VisplaneExplorerMode.cs @@ -5,7 +5,8 @@ using System.Collections.Generic; using System.Drawing; using System.Drawing.Imaging; using System.IO; -using System.Runtime.InteropServices; +using System.Linq; +using System.Text; using System.Windows.Forms; using CodeImp.DoomBuilder.Data; using CodeImp.DoomBuilder.Editing; @@ -250,11 +251,11 @@ namespace CodeImp.DoomBuilder.Plugins.VisplaneExplorer using (BinaryReader reader = new BinaryReader(stream)) { - List formats = new List { "ZNOD", "XNOD" }; + List formats = new List { Encoding.ASCII.GetBytes("ZNOD"), Encoding.ASCII.GetBytes("XNOD") }; - string nodesformat = new string(reader.ReadChars(4)); + byte[] format = reader.ReadBytes(4); - if (formats.Contains(nodesformat)) + if(formats.Any(f => f.SequenceEqual(format))) throw new Exception("ZDBSP nodes detected. This format is not supporeted by the Visplane Explorer Mode"); } }