mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-26 09:35:28 +00:00
Update lookup only after sorting files
This commit is contained in:
parent
3920477618
commit
b61249841e
@ -182,8 +182,6 @@ void BSAFile::readHeader()
|
|||||||
if(fs.offset + fs.fileSize > fsize)
|
if(fs.offset + fs.fileSize > fsize)
|
||||||
fail("Archive contains offsets outside itself");
|
fail("Archive contains offsets outside itself");
|
||||||
|
|
||||||
// Add the file name to the lookup
|
|
||||||
mLookup[fs.name()] = i;
|
|
||||||
}
|
}
|
||||||
mStringBuf.resize(endOfNameBuffer);
|
mStringBuf.resize(endOfNameBuffer);
|
||||||
|
|
||||||
@ -191,6 +189,13 @@ void BSAFile::readHeader()
|
|||||||
return left.offset < right.offset;
|
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;
|
mIsLoaded = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user