Internal: sort sector levels only if there are more than 2 of them in a given sector.

This commit is contained in:
MaxED 2014-09-23 23:29:04 +00:00
parent 88ae568836
commit c98c9b4990

View file

@ -268,10 +268,13 @@ namespace CodeImp.DoomBuilder.BuilderModes
foreach(SectorEffect e in alleffects) foreach(SectorEffect e in alleffects)
e.Update(); e.Update();
// Sort the levels (but not the first and the last) // Sort the levels (only if there are more than 2 sector levels - mxd)
SectorLevelComparer comparer = new SectorLevelComparer(sector); if (lightlevels.Count > 2)
lightlevels.Sort(0, lightlevels.Count, comparer); //mxd. Was lightlevels.Sort(1, lightlevels.Count - 2, comparer); {
SectorLevelComparer comparer = new SectorLevelComparer(sector);
lightlevels.Sort(0, lightlevels.Count, comparer); //mxd. Was lightlevels.Sort(1, lightlevels.Count - 2, comparer);
}
// Now that we know the levels in this sector (and in the right order) we // Now that we know the levels in this sector (and in the right order) we
// can determine the lighting in between and on the levels. // can determine the lighting in between and on the levels.
// Start from the absolute ceiling and go down to 'cast' the lighting // Start from the absolute ceiling and go down to 'cast' the lighting