From de061048b5e3a107913495c8aa1459587fee68e5 Mon Sep 17 00:00:00 2001 From: WrinklyNinja Date: Mon, 27 Jan 2014 14:37:23 +0000 Subject: [PATCH] Issue #79 fix. Apparently in Skyrim BSAs need to have the same basename as plugins, not just start the same. --- src/backend/metadata.cpp | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/src/backend/metadata.cpp b/src/backend/metadata.cpp index d7404860..ac9797f0 100644 --- a/src/backend/metadata.cpp +++ b/src/backend/metadata.cpp @@ -721,20 +721,9 @@ namespace boss { } bool Plugin::LoadsBSA(const Game& game) const { - if (game.Id() != g_game_tes5) + if (game.Id() != g_game_tes5 || IsRegexPlugin()) return false; - //BSAs must start with the plugin basename and have the extension .bsa. - for (boost::filesystem::directory_iterator it(game.DataPath()); it != boost::filesystem::directory_iterator(); ++it) { - if (boost::filesystem::is_regular_file(it->status()) && boost::iequals(it->path().extension().string(), ".bsa")) { - BOOST_LOG_TRIVIAL(info) << name << " | " << it->path().filename().string(); - if (!IsRegexPlugin() && boost::istarts_with(it->path().filename().string(), name.substr(0, name.length() - 4))) - return true; - else if (IsRegexPlugin() && boost::regex_search(it->path().filename().string(), boost::regex(name.substr(0, name.length() - 5), boost::regex::perl | boost::regex::icase), boost::match_continuous)) { - return true; - } - } - } - return false; + return boost::filesystem::exists(game.DataPath() / (name.substr(0, name.length() - 3) + "bsa")); } bool operator == (const File& lhs, const Plugin& rhs) {