From d2244c8d976f48ea2bce10572e5ee8c4f12b4f47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Mocquillon?= Date: Fri, 3 Mar 2023 20:49:31 +0100 Subject: [PATCH] Fix detectVersion --- components/bsa/bsa_file.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/components/bsa/bsa_file.cpp b/components/bsa/bsa_file.cpp index a8604dfe83..8fc2d3f8d9 100644 --- a/components/bsa/bsa_file.cpp +++ b/components/bsa/bsa_file.cpp @@ -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(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;