Adds check for disabled cheats to prevent them from being added to the CheatList

This commit is contained in:
Morph
2019-11-28 00:35:18 -05:00
parent 6df6caaf5f
commit 9ac9c55e0f

View File

@@ -284,12 +284,16 @@ std::vector<Memory::CheatEntry> PatchManager::CreateCheatList(
return {};
}
const auto& disabled = Settings::values.disabled_addons[title_id];
auto patch_dirs = load_dir->GetSubdirectories();
std::sort(patch_dirs.begin(), patch_dirs.end(),
[](const VirtualDir& l, const VirtualDir& r) { return l->GetName() < r->GetName(); });
std::vector<Memory::CheatEntry> out;
for (const auto& subdir : patch_dirs) {
if (std::find(disabled.begin(), disabled.end(), subdir->GetName()) != disabled.end())
continue;
auto cheats_dir = subdir->GetSubdirectory("cheats");
if (cheats_dir != nullptr) {
auto res = ReadCheatFileFromFolder(system, title_id, build_id_, cheats_dir, true);