Maufeat 1 month ago
committed by crueter
parent
commit
6893be8a6c
  1. 20
      src/core/file_sys/patch_manager.cpp

20
src/core/file_sys/patch_manager.cpp

@ -660,19 +660,20 @@ std::vector<Patch> PatchManager::GetPatches(VirtualFile update_raw, const BuildI
.title_id = title_id, .title_id = title_id,
.parent_name = ""}); .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<std::vector<Service::DMNT::CheatEntry>> cheat_entries;
// Add individual cheats as sub-entries
if (has_cheats) {
// Try to read cheat file with build_id first, fallback to all files
std::vector<Service::DMNT::CheatEntry> cheat_entries;
if (has_build_id) {
if (auto res = ReadCheatFileFromFolder(title_id, build_id, cheats_dir, true)) { if (auto res = ReadCheatFileFromFolder(title_id, build_id, cheats_dir, true)) {
cheat_entries = std::move(res);
cheat_entries = std::move(*res);
} else if (auto res_lower = ReadCheatFileFromFolder(title_id, build_id, cheats_dir, false)) { } else if (auto res_lower = ReadCheatFileFromFolder(title_id, build_id, cheats_dir, false)) {
cheat_entries = std::move(res_lower);
cheat_entries = std::move(*res_lower);
}
} }
if (cheat_entries) {
for (const auto& cheat : *cheat_entries) {
for (const auto& cheat : cheat_entries) {
// Skip master cheat (id 0) with no readable name // Skip master cheat (id 0) with no readable name
if (cheat.cheat_id == 0 && cheat.definition.readable_name[0] == '\0') { if (cheat.cheat_id == 0 && cheat.definition.readable_name[0] == '\0') {
continue; continue;
@ -699,7 +700,6 @@ std::vector<Patch> PatchManager::GetPatches(VirtualFile update_raw, const BuildI
} }
} }
} }
}
// SDMC mod directory (RomFS LayeredFS) // SDMC mod directory (RomFS LayeredFS)
const auto sdmc_mod_dir = fs_controller.GetSDMCModificationLoadRoot(title_id); const auto sdmc_mod_dir = fs_controller.GetSDMCModificationLoadRoot(title_id);

Loading…
Cancel
Save