mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Issue #79 fix.
Apparently in Skyrim BSAs need to have the same basename as plugins, not just start the same.
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user