mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2024-11-23 04:12:12 +00:00
WADReader: another fix to patches outside of patch ranges detection logic.
This commit is contained in:
parent
8132584155
commit
0d6f9a2594
1 changed files with 13 additions and 17 deletions
|
@ -102,32 +102,28 @@ namespace CodeImp.DoomBuilder.Data
|
|||
invertedflatranges = new List<LumpRange>();
|
||||
|
||||
if(flatranges.Count > 0) {
|
||||
//add range before first flatrange
|
||||
if (flatranges[0].start > 0) {
|
||||
LumpRange range = new LumpRange {start = 0, end = flatranges[0].start - 1};
|
||||
invertedflatranges.Add(range);
|
||||
}
|
||||
|
||||
//add ranges between flatranges
|
||||
for(int i = 1; i < flatranges.Count; i++) {
|
||||
LumpRange range = new LumpRange { start = flatranges[i - 1].end + 1, end = flatranges[i].start - 1 };
|
||||
invertedflatranges.Add(range);
|
||||
}
|
||||
|
||||
//add range after last flatrange
|
||||
if(flatranges[flatranges.Count - 1].end < file.Lumps.Count - 1) {
|
||||
LumpRange range = new LumpRange { start = flatranges[flatranges.Count - 1].end + 1, end = file.Lumps.Count - 1 };
|
||||
invertedflatranges.Add(range);
|
||||
}
|
||||
} else { // No flat ranges? Make one giant range then...
|
||||
LumpRange range = new LumpRange {start = 0, end = file.Lumps.Count - 1};
|
||||
invertedflatranges.Add(range);
|
||||
}
|
||||
|
||||
for (int i = 1; i < flatranges.Count; i++) {
|
||||
if (flatranges[i].start == 0) continue;
|
||||
LumpRange range = new LumpRange();
|
||||
|
||||
if(i == flatranges.Count - 1) {
|
||||
if (flatranges[i].end < file.Lumps.Count - 1) {
|
||||
range.start = flatranges[i].end + 1;
|
||||
range.end = file.Lumps.Count - 1;
|
||||
invertedflatranges.Add(range);
|
||||
}
|
||||
} else {
|
||||
range.start = flatranges[i - 1].end + 1;
|
||||
range.end = flatranges[i].start - 1;
|
||||
invertedflatranges.Add(range);
|
||||
}
|
||||
}
|
||||
|
||||
// We have no destructor
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue