mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-02-18 18:11:13 +00:00
Fixed a broken lookup update logic in WAD.Remove() and WAD.RemoveAt().
This commit is contained in:
parent
fa1a1d42f6
commit
f924dbcbbb
1 changed files with 22 additions and 2 deletions
|
@ -303,7 +303,17 @@ namespace CodeImp.DoomBuilder.IO
|
|||
// Remove from list
|
||||
Lump l = lumps[index];
|
||||
lumps.RemoveAt(index);
|
||||
lookup[l.LongName].Remove(index); //mxd
|
||||
|
||||
// Remove from lookup (mxd)
|
||||
if(lookup[l.LongName].Count > 0)
|
||||
{
|
||||
lookup[l.LongName].Remove(index);
|
||||
}
|
||||
else
|
||||
{
|
||||
lookup.Remove(l.LongName);
|
||||
}
|
||||
|
||||
l.Dispose();
|
||||
numlumps--;
|
||||
|
||||
|
@ -318,7 +328,17 @@ namespace CodeImp.DoomBuilder.IO
|
|||
int pos = lumps.IndexOf(lump); //mxd
|
||||
lumps.Remove(lump);
|
||||
lump.Dispose();
|
||||
lookup[lump.LongName].Remove(pos); //mxd
|
||||
|
||||
// Remove from lookup (mxd)
|
||||
if (lookup[lump.LongName].Count > 0)
|
||||
{
|
||||
lookup[lump.LongName].Remove(pos);
|
||||
}
|
||||
else
|
||||
{
|
||||
lookup.Remove(lump.LongName);
|
||||
}
|
||||
|
||||
numlumps--;
|
||||
|
||||
// Write the new headers
|
||||
|
|
Loading…
Reference in a new issue