Add console warning if two SOC_/LUA_ lumps with the same name are found

This commit is contained in:
MascaraSnake 2017-01-12 09:44:30 +01:00
parent a9a60b3803
commit 478012b4f2

View file

@ -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);
}
}