1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-26 03:52:01 +02:00

extractToFolder fix with entry.offset is set to 0

This commit is contained in:
krs 2022-12-06 22:33:58 +02:00 committed by Nordsoft91
parent 35db24a443
commit ed70c69a2b

View File

@ -231,15 +231,8 @@ void CArchiveLoader::extractToFolder(const std::string & outputSubFolder, const
{
std::unique_ptr<CInputStream> inputStream = load(ResourceID(mountPoint + entry.name));
std::vector<ui8> data(entry.fullSize);
inputStream->read(data.data(), entry.fullSize);
bfs::path extractedFilePath = createExtractedFilePath(outputSubFolder, entry.name);
// writeToOutputFile
std::ofstream out(extractedFilePath.string(), std::ofstream::binary);
out.exceptions(std::ifstream::failbit | std::ifstream::badbit);
out.write((char*)data.data(), entry.fullSize);
entry.offset = 0;
extractToFolder(outputSubFolder, *inputStream, entry);
}
bfs::path createExtractedFilePath(const std::string & outputSubFolder, const std::string & entryName)