From 6a486d34029e391c127a07151322141064d81f4d Mon Sep 17 00:00:00 2001 From: Megamouse Date: Sat, 27 Jun 2020 14:13:28 +0200 Subject: [PATCH] patch_manager: only apply one patch per group So far this was purely handled in the GUI --- Utilities/bin_patch.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Utilities/bin_patch.cpp b/Utilities/bin_patch.cpp index 16d317c0f3..113ce1ccc4 100644 --- a/Utilities/bin_patch.cpp +++ b/Utilities/bin_patch.cpp @@ -551,6 +551,9 @@ std::size_t patch_engine::apply_patch(const std::string& name, u8* dst, u32 file const auto serial = Emu.GetTitleID(); const auto app_version = Emu.GetAppVersion(); + // Only one patch per patch group is allowed + std::set applied_groups; + // Apply modifications sequentially for (const auto& [description, patch] : container.patch_info_map) { @@ -601,6 +604,16 @@ std::size_t patch_engine::apply_patch(const std::string& name, u8* dst, u32 file continue; } + if (!patch.patch_group.empty()) + { + if (applied_groups.contains(patch.patch_group)) + { + continue; + } + + applied_groups.insert(patch.patch_group); + } + size_t applied = 0; for (const auto& p : patch.data_list)