[Patcher] Fixed loading of disabled plugins

This commit is contained in:
Adrian 2023-08-08 21:09:16 +01:00 committed by Radosław Gliński
parent f743cf1e65
commit dc29307a55
1 changed files with 9 additions and 9 deletions

View File

@ -140,14 +140,14 @@ std::vector<uint64_t> PluginLoader::GetHashes(
bool PluginLoader::IsAnyPluginForTitleAvailable( bool PluginLoader::IsAnyPluginForTitleAvailable(
const uint32_t title_id, const uint64_t module_hash) const { const uint32_t title_id, const uint64_t module_hash) const {
const auto result = const auto result = std::find_if(
std::find_if(plugin_configs_.cbegin(), plugin_configs_.cend(), plugin_configs_.cbegin(), plugin_configs_.cend(),
[title_id, module_hash](const PluginInfoEntry& entry) { [title_id, module_hash](const PluginInfoEntry& entry) {
const auto hash_exists = const auto hash_exists =
std::find(entry.hashes.cbegin(), entry.hashes.cend(), std::find(entry.hashes.cbegin(), entry.hashes.cend(),
module_hash) != entry.hashes.cend(); module_hash) != entry.hashes.cend();
return entry.title_id == title_id && hash_exists; return entry.is_enabled && entry.title_id == title_id && hash_exists;
}); });
return result != plugin_configs_.cend(); return result != plugin_configs_.cend();
@ -159,7 +159,7 @@ void PluginLoader::LoadTitlePlugins(const uint32_t title_id) {
std::copy_if(plugin_configs_.cbegin(), plugin_configs_.cend(), std::copy_if(plugin_configs_.cbegin(), plugin_configs_.cend(),
std::back_inserter(title_plugins), std::back_inserter(title_plugins),
[title_id](const PluginInfoEntry& entry) { [title_id](const PluginInfoEntry& entry) {
return entry.title_id == title_id; return entry.is_enabled && entry.title_id == title_id;
}); });
if (title_plugins.empty()) { if (title_plugins.empty()) {