(S25Opener): sort entries by offset.

This commit is contained in:
morkt 2015-06-22 02:56:05 +04:00
parent dfc22f87bb
commit c6d5a78c8e

View File

@ -71,6 +71,7 @@ namespace GameRes.Formats.ShiinaRio
dir.Add (entry);
}
}
dir.Sort ((a, b) => (int)(a.Offset - b.Offset));
for (int i = 0; i < dir.Count; ++i)
{
long next_offset;
@ -78,8 +79,6 @@ namespace GameRes.Formats.ShiinaRio
next_offset = file.MaxOffset;
else
next_offset = dir[i+1].Offset;
if (next_offset < dir[i].Offset)
return null;
dir[i].Size = (uint)(next_offset - dir[i].Offset);
}
return new ArcFile (file, this, dir);