mirror of
https://git.do.srb2.org/STJr/ZoneBuilder.git
synced 2025-03-03 08:01:11 +00:00
Don't freak out when a WAD contains multiple script lumps with the same name - just ignore the duplicates.
This commit is contained in:
parent
a1850cd82c
commit
ee69237aad
2 changed files with 6 additions and 2 deletions
|
@ -166,6 +166,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
//Load the global script lumps
|
||||
foreach (ScriptLumpInfo scriptlumpinfo in General.Map.Config.ScriptLumps.Values)
|
||||
{
|
||||
List<string> addedLumps = new List<string>();
|
||||
if (scriptlumpinfo.Script != null)
|
||||
{
|
||||
if (scriptlumpinfo.IsPrefix)
|
||||
|
@ -174,6 +175,8 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
{
|
||||
if (l.Name.ToUpperInvariant().StartsWith(scriptlumpinfo.Name.ToUpperInvariant()))
|
||||
{
|
||||
//Don't add lumps with duplicate names.
|
||||
if (addedLumps.Contains(l.Name.ToUpperInvariant())) continue;
|
||||
GlobalScriptLumpDocumentTab t = new GlobalScriptLumpDocumentTab(this, l.Name, scriptlumpinfo.Script, General.Map.FilePathName);
|
||||
|
||||
//mxd. Apply stored settings?
|
||||
|
@ -187,6 +190,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
t.OnTextChanged += tabpage_OnTextChanged;
|
||||
t.Scintilla.UpdateUI += scintilla_OnUpdateUI;
|
||||
tabs.TabPages.Add(t);
|
||||
addedLumps.Add(l.Name.ToUpperInvariant());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -872,7 +872,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
|
||||
foreach (Lump lump in file.Lumps)
|
||||
{
|
||||
if (lump.Name.StartsWith(prefix))
|
||||
if (lump.Name.StartsWith(prefix) && !streams.ContainsKey(lump.Name))
|
||||
{
|
||||
streams.Add(lump.Name, lump.Stream);
|
||||
}
|
||||
|
@ -889,7 +889,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
|
||||
foreach (Lump lump in file.Lumps)
|
||||
{
|
||||
if (lump.Name.StartsWith(prefix))
|
||||
if (lump.Name.StartsWith(prefix) && !streams.ContainsKey(lump.Name))
|
||||
{
|
||||
streams.Add(lump.Name, lump.Stream);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue