Don't iterate over all sectors twice in RebuildElementData.

This commit is contained in:
sphere 2021-10-17 14:52:19 +02:00
parent e9c9d008ff
commit 34831d6042
1 changed files with 2 additions and 5 deletions

View File

@ -847,19 +847,16 @@ namespace CodeImp.DoomBuilder.BuilderModes
if (!General.Settings.GZDoomRenderingEffects) return; //mxd if (!General.Settings.GZDoomRenderingEffects) return; //mxd
// Find all sector who's tag is not 0 and hash them so that we can find them quicly
foreach (Sector s in General.Map.Map.Sectors) foreach (Sector s in General.Map.Map.Sectors)
{ {
foreach(int tag in s.Tags) // Find all sector whose tag is not 0 and hash them so that we can find them quickly
foreach (int tag in s.Tags)
{ {
if(tag == 0) continue; if(tag == 0) continue;
if(!sectortags.ContainsKey(tag)) sectortags[tag] = new List<Sector>(); if(!sectortags.ContainsKey(tag)) sectortags[tag] = new List<Sector>();
sectortags[tag].Add(s); sectortags[tag].Add(s);
} }
}
foreach (Sector s in General.Map.Map.Sectors)
{
if (General.Map.SRB2) s.Fields.Clear(); //Reset fake UDMF properties (since the linedef special that set them might no longer be there) if (General.Map.SRB2) s.Fields.Clear(); //Reset fake UDMF properties (since the linedef special that set them might no longer be there)
else else
{ {