patch_manager: only apply one patch per group

So far this was purely handled in the GUI
This commit is contained in:
Megamouse 2020-06-27 14:13:28 +02:00
parent e43db24b2c
commit 6a486d3402
1 changed files with 13 additions and 0 deletions

View File

@ -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<std::string> 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)