From 478012b4f28af6bd5df31c568f79fc6eb9ec42f1 Mon Sep 17 00:00:00 2001 From: MascaraSnake Date: Thu, 12 Jan 2017 09:44:30 +0100 Subject: [PATCH] Add console warning if two SOC_/LUA_ lumps with the same name are found --- Source/Core/Data/WADReader.cs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Source/Core/Data/WADReader.cs b/Source/Core/Data/WADReader.cs index aeddd31..6443a08 100644 --- a/Source/Core/Data/WADReader.cs +++ b/Source/Core/Data/WADReader.cs @@ -872,8 +872,13 @@ namespace CodeImp.DoomBuilder.Data foreach (Lump lump in file.Lumps) { - if (lump.Name.StartsWith(prefix) && !streams.ContainsKey(lump.Name)) + if (lump.Name.StartsWith(prefix)) { + if (streams.ContainsKey(lump.Name)) + { + General.ErrorLogger.Add(ErrorType.Warning, "Found multiple lumps with the name " + lump.Name + ". All but the first one will be ignored!"); + continue; + } streams.Add(lump.Name, lump.Stream); } } @@ -889,8 +894,13 @@ namespace CodeImp.DoomBuilder.Data foreach (Lump lump in file.Lumps) { - if (lump.Name.StartsWith(prefix) && !streams.ContainsKey(lump.Name)) + if (lump.Name.StartsWith(prefix)) { + if (streams.ContainsKey(lump.Name)) + { + General.ErrorLogger.Add(ErrorType.Warning, "Found multiple lumps with the name " + lump.Name + ". All but the first one will be ignored!"); + continue; + } streams.Add(lump.Name, lump.Stream); } }