Fixed: when switching to a different map format, all nodes with "nodebuild" property set to true in the "maplumpnames" block of current game configuration are now removed.

This commit is contained in:
MaxED 2014-11-02 19:02:01 +00:00
parent 77ba424fdd
commit 840cdf66bc

View file

@ -1063,11 +1063,17 @@ namespace CodeImp.DoomBuilder {
} }
//mxd. This is called on tempwad, which should only have the current map inside it. //mxd. This is called on tempwad, which should only have the current map inside it.
private void removeUnneededLumps(WAD target, string mapname) { private void RemoveUnneededLumps(WAD target, string mapname)
{
//Get the list of lumps required by current map format //Get the list of lumps required by current map format
List<string> requiredLumps = new List<string>(); List<string> requiredLumps = new List<string>();
foreach (DictionaryEntry ml in config.MapLumpNames){ foreach(KeyValuePair<string, MapLumpInfo> group in config.MapLumps)
string lumpname = ml.Key.ToString(); {
if(group.Value.nodebuild) continue; //this lump well be recreated by a nodebuilder when saving the map
//(or it won't be if the new map format doesn't require this lump,
//so it will just stay there, possibly messing things up)
string lumpname = group.Key;
if(lumpname == CONFIG_MAP_HEADER) lumpname = mapname; if(lumpname == CONFIG_MAP_HEADER) lumpname = mapname;
requiredLumps.Add(lumpname); requiredLumps.Add(lumpname);
} }
@ -1767,7 +1773,7 @@ namespace CodeImp.DoomBuilder {
//mxd. Some lumps may've become unneeded during map format conversion. //mxd. Some lumps may've become unneeded during map format conversion.
if(oldFormatInterface != config.FormatInterface) if(oldFormatInterface != config.FormatInterface)
removeUnneededLumps(tempwad, TEMP_MAP_HEADER); RemoveUnneededLumps(tempwad, TEMP_MAP_HEADER);
// Create required lumps if they don't exist yet // Create required lumps if they don't exist yet
CreateRequiredLumps(tempwad, TEMP_MAP_HEADER); CreateRequiredLumps(tempwad, TEMP_MAP_HEADER);