From 61b6150c017f693a208faa2e2207bce9780a9674 Mon Sep 17 00:00:00 2001 From: Alexei Kotov Date: Fri, 26 Apr 2024 10:49:29 +0300 Subject: [PATCH] Properly detect the version for post-FO4 BA2 formats --- components/bsa/bsa_file.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/components/bsa/bsa_file.cpp b/components/bsa/bsa_file.cpp index 4704e6e7e0..46639a729e 100644 --- a/components/bsa/bsa_file.cpp +++ b/components/bsa/bsa_file.cpp @@ -340,18 +340,18 @@ BsaVersion Bsa::BSAFile::detectVersion(const std::filesystem::path& filePath) return BsaVersion::Uncompressed; } - if (head[0] == static_cast(BsaVersion::Compressed) || head[0] == ESM::fourCC("BTDX")) + if (head[0] == static_cast(BsaVersion::Compressed)) { - if (head[1] == static_cast(0x01)) - { - if (head[2] == ESM::fourCC("GNRL")) - return BsaVersion::BA2GNRL; - if (head[2] == ESM::fourCC("DX10")) - return BsaVersion::BA2DX10; - return BsaVersion::Unknown; - } return BsaVersion::Compressed; } + if (head[0] == ESM::fourCC("BTDX")) + { + if (head[2] == ESM::fourCC("GNRL")) + return BsaVersion::BA2GNRL; + if (head[2] == ESM::fourCC("DX10")) + return BsaVersion::BA2DX10; + } + return BsaVersion::Unknown; }