1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-18 13:12:50 +00:00

Update lookup only after sorting files

This commit is contained in:
CedricMocquillon 2021-05-19 18:38:42 +02:00
parent 3920477618
commit b61249841e

View File

@ -182,8 +182,6 @@ void BSAFile::readHeader()
if(fs.offset + fs.fileSize > fsize)
fail("Archive contains offsets outside itself");
// Add the file name to the lookup
mLookup[fs.name()] = i;
}
mStringBuf.resize(endOfNameBuffer);
@ -191,6 +189,13 @@ void BSAFile::readHeader()
return left.offset < right.offset;
});
for (size_t i = 0; i < filenum; i++)
{
FileStruct& fs = mFiles[i];
// Add the file name to the lookup
mLookup[fs.name()] = i;
}
mIsLoaded = true;
}