1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2024-12-29 03:19:44 +00:00

Fix detectVersion

This commit is contained in:
Cédric Mocquillon 2023-03-03 20:49:31 +01:00
parent 78251a2bb1
commit d2244c8d97

View File

@ -365,12 +365,14 @@ BsaVersion Bsa::BSAFile::detectVersion(const std::filesystem::path& filePath)
if (head[0] == ESM::fourCC("BTDX"))
{
// head[1] should contains 0x01 it is checked if we want to open this kind of archive
if (head[2] == ESM::fourCC("GNRL"))
return BSAVER_BA2_GNRL;
if (head[2] == ESM::fourCC("DX10"))
return BSAVER_BA2_DX10;
return BSAVER_UNKNOWN;
if (head[1] == static_cast<uint32_t>(0x01))
{
if (head[2] == ESM::fourCC("GNRL"))
return BSAVER_BA2_GNRL;
if (head[2] == ESM::fourCC("DX10"))
return BSAVER_BA2_DX10;
}
return BSAVER_COMPRESSED;
}
return BSAVER_UNKNOWN;