Fixed major bug in MapSet IO implementations (how can I have missed this?!)

This commit is contained in:
codeimp 2008-11-10 21:06:02 +00:00
parent fc44793fd2
commit 869113c389
4 changed files with 22 additions and 14 deletions

View file

@ -852,7 +852,7 @@ namespace CodeImp.DoomBuilder
}
}
}
// Nothing found
return -1;
}
@ -1099,8 +1099,16 @@ namespace CodeImp.DoomBuilder
// This checks if the scripts are changed
internal bool CheckScriptChanged()
{
// Check if lumps are changed
return scriptschanged || scriptwindow.Editor.CheckImplicitChanges();
if(scriptwindow != null)
{
// Check if scripts are changed
return scriptschanged || scriptwindow.Editor.CheckImplicitChanges();
}
else
{
// Check if scripts are changed
return scriptschanged;
}
}
#endregion

View file

@ -375,7 +375,7 @@ namespace CodeImp.DoomBuilder.IO
}
// Find insert position and remove old lump
insertpos = MapManager.RemoveSpecificLump(wad, "THINGS", position, "", maplumps);
insertpos = MapManager.RemoveSpecificLump(wad, "THINGS", position, MapManager.TEMP_MAP_HEADER, maplumps);
if(insertpos == -1) insertpos = position + 1;
if(insertpos > wad.Lumps.Count) insertpos = wad.Lumps.Count;
@ -407,7 +407,7 @@ namespace CodeImp.DoomBuilder.IO
}
// Find insert position and remove old lump
insertpos = MapManager.RemoveSpecificLump(wad, "VERTEXES", position, "", maplumps);
insertpos = MapManager.RemoveSpecificLump(wad, "VERTEXES", position, MapManager.TEMP_MAP_HEADER, maplumps);
if(insertpos == -1) insertpos = position + 1;
if(insertpos > wad.Lumps.Count) insertpos = wad.Lumps.Count;
@ -462,7 +462,7 @@ namespace CodeImp.DoomBuilder.IO
}
// Find insert position and remove old lump
insertpos = MapManager.RemoveSpecificLump(wad, "LINEDEFS", position, "", maplumps);
insertpos = MapManager.RemoveSpecificLump(wad, "LINEDEFS", position, MapManager.TEMP_MAP_HEADER, maplumps);
if(insertpos == -1) insertpos = position + 1;
if(insertpos > wad.Lumps.Count) insertpos = wad.Lumps.Count;
@ -498,7 +498,7 @@ namespace CodeImp.DoomBuilder.IO
}
// Find insert position and remove old lump
insertpos = MapManager.RemoveSpecificLump(wad, "SIDEDEFS", position, "", maplumps);
insertpos = MapManager.RemoveSpecificLump(wad, "SIDEDEFS", position, MapManager.TEMP_MAP_HEADER, maplumps);
if(insertpos == -1) insertpos = position + 1;
if(insertpos > wad.Lumps.Count) insertpos = wad.Lumps.Count;
@ -535,7 +535,7 @@ namespace CodeImp.DoomBuilder.IO
}
// Find insert position and remove old lump
insertpos = MapManager.RemoveSpecificLump(wad, "SECTORS", position, "", maplumps);
insertpos = MapManager.RemoveSpecificLump(wad, "SECTORS", position, MapManager.TEMP_MAP_HEADER, maplumps);
if(insertpos == -1) insertpos = position + 1;
if(insertpos > wad.Lumps.Count) insertpos = wad.Lumps.Count;

View file

@ -399,7 +399,7 @@ namespace CodeImp.DoomBuilder.IO
}
// Find insert position and remove old lump
insertpos = MapManager.RemoveSpecificLump(wad, "THINGS", position, "", maplumps);
insertpos = MapManager.RemoveSpecificLump(wad, "THINGS", position, MapManager.TEMP_MAP_HEADER, maplumps);
if(insertpos == -1) insertpos = position + 1;
if(insertpos > wad.Lumps.Count) insertpos = wad.Lumps.Count;
@ -430,7 +430,7 @@ namespace CodeImp.DoomBuilder.IO
}
// Find insert position and remove old lump
insertpos = MapManager.RemoveSpecificLump(wad, "VERTEXES", position, "", maplumps);
insertpos = MapManager.RemoveSpecificLump(wad, "VERTEXES", position, MapManager.TEMP_MAP_HEADER, maplumps);
if(insertpos == -1) insertpos = position + 1;
if(insertpos > wad.Lumps.Count) insertpos = wad.Lumps.Count;
@ -491,7 +491,7 @@ namespace CodeImp.DoomBuilder.IO
}
// Find insert position and remove old lump
insertpos = MapManager.RemoveSpecificLump(wad, "LINEDEFS", position, "", maplumps);
insertpos = MapManager.RemoveSpecificLump(wad, "LINEDEFS", position, MapManager.TEMP_MAP_HEADER, maplumps);
if(insertpos == -1) insertpos = position + 1;
if(insertpos > wad.Lumps.Count) insertpos = wad.Lumps.Count;
@ -526,7 +526,7 @@ namespace CodeImp.DoomBuilder.IO
}
// Find insert position and remove old lump
insertpos = MapManager.RemoveSpecificLump(wad, "SIDEDEFS", position, "", maplumps);
insertpos = MapManager.RemoveSpecificLump(wad, "SIDEDEFS", position, MapManager.TEMP_MAP_HEADER, maplumps);
if(insertpos == -1) insertpos = position + 1;
if(insertpos > wad.Lumps.Count) insertpos = wad.Lumps.Count;
@ -562,7 +562,7 @@ namespace CodeImp.DoomBuilder.IO
}
// Find insert position and remove old lump
insertpos = MapManager.RemoveSpecificLump(wad, "SECTORS", position, "", maplumps);
insertpos = MapManager.RemoveSpecificLump(wad, "SECTORS", position, MapManager.TEMP_MAP_HEADER, maplumps);
if(insertpos == -1) insertpos = position + 1;
if(insertpos > wad.Lumps.Count) insertpos = wad.Lumps.Count;

View file

@ -142,7 +142,7 @@ namespace CodeImp.DoomBuilder.IO
udmfwriter.Write(map, memstream, manager.Config.EngineName);
// Find insert position and remove old lump
int insertpos = MapManager.RemoveSpecificLump(wad, "TEXTMAP", position, "", manager.Config.MapLumpNames);
int insertpos = MapManager.RemoveSpecificLump(wad, "TEXTMAP", position, MapManager.TEMP_MAP_HEADER, manager.Config.MapLumpNames);
if(insertpos == -1) insertpos = position + 1;
if(insertpos > wad.Lumps.Count) insertpos = wad.Lumps.Count;