From 6893be8a6c98b8df13c5e54ba24af8ee3a285554 Mon Sep 17 00:00:00 2001 From: Maufeat Date: Wed, 21 Jan 2026 09:37:06 +0100 Subject: [PATCH] mhmh --- src/core/file_sys/patch_manager.cpp | 66 ++++++++++++++--------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/src/core/file_sys/patch_manager.cpp b/src/core/file_sys/patch_manager.cpp index ceea3437a3..92f826e5c1 100644 --- a/src/core/file_sys/patch_manager.cpp +++ b/src/core/file_sys/patch_manager.cpp @@ -660,42 +660,42 @@ std::vector PatchManager::GetPatches(VirtualFile update_raw, const BuildI .title_id = title_id, .parent_name = ""}); - // Add individual cheats as sub-entries if we have a build_id - // Always show cheats even if mod folder is disabled, so users can enable individual cheats - if (has_cheats && has_build_id) { - // Try to read cheat file (uppercase first, then lowercase) - std::optional> cheat_entries; - if (auto res = ReadCheatFileFromFolder(title_id, build_id, cheats_dir, true)) { - cheat_entries = std::move(res); - } else if (auto res_lower = ReadCheatFileFromFolder(title_id, build_id, cheats_dir, false)) { - cheat_entries = std::move(res_lower); + // Add individual cheats as sub-entries + if (has_cheats) { + // Try to read cheat file with build_id first, fallback to all files + std::vector cheat_entries; + + if (has_build_id) { + if (auto res = ReadCheatFileFromFolder(title_id, build_id, cheats_dir, true)) { + cheat_entries = std::move(*res); + } else if (auto res_lower = ReadCheatFileFromFolder(title_id, build_id, cheats_dir, false)) { + cheat_entries = std::move(*res_lower); + } } - if (cheat_entries) { - for (const auto& cheat : *cheat_entries) { - // Skip master cheat (id 0) with no readable name - if (cheat.cheat_id == 0 && cheat.definition.readable_name[0] == '\0') { - continue; - } - - const std::string cheat_name = cheat.definition.readable_name.data(); - if (cheat_name.empty()) { - continue; - } - - // Create unique key for this cheat: "ModName::CheatName" - const std::string cheat_key = mod->GetName() + "::" + cheat_name; - const auto cheat_disabled = - std::find(disabled.begin(), disabled.end(), cheat_key) != disabled.end(); - - out.push_back({.enabled = !cheat_disabled, - .name = cheat_name, - .version = types, - .type = PatchType::Cheat, - .program_id = title_id, - .title_id = title_id, - .parent_name = mod->GetName()}); + for (const auto& cheat : cheat_entries) { + // Skip master cheat (id 0) with no readable name + if (cheat.cheat_id == 0 && cheat.definition.readable_name[0] == '\0') { + continue; + } + + const std::string cheat_name = cheat.definition.readable_name.data(); + if (cheat_name.empty()) { + continue; } + + // Create unique key for this cheat: "ModName::CheatName" + const std::string cheat_key = mod->GetName() + "::" + cheat_name; + const auto cheat_disabled = + std::find(disabled.begin(), disabled.end(), cheat_key) != disabled.end(); + + out.push_back({.enabled = !cheat_disabled, + .name = cheat_name, + .version = types, + .type = PatchType::Cheat, + .program_id = title_id, + .title_id = title_id, + .parent_name = mod->GetName()}); } } }