mirror of https://github.com/PCSX2/pcsx2.git
GameDB: Detect and skip patches with duplicate CRCs
This commit is contained in:
parent
b800ed0a10
commit
dc52ec7aec
|
@ -137,10 +137,19 @@ GameDatabaseSchema::GameEntry YamlGameDatabaseImpl::entryFromYaml(const std::str
|
|||
for (YAML::const_iterator it = patches.begin(); it != patches.end(); ++it)
|
||||
{
|
||||
const YAML::Node& node = *it;
|
||||
std::string crc = safeGetString(node, "crc", "default");
|
||||
|
||||
if (gameEntry.patches.count(crc) == 1)
|
||||
{
|
||||
Console.Error(fmt::format("[GameDB] Patch with duplicate CRC: '{}' detected for serial: '{}'. Skipping patch.", crc, serial));
|
||||
continue;
|
||||
}
|
||||
|
||||
GameDatabaseSchema::Patch patchCol;
|
||||
|
||||
patchCol.author = safeGetString(node, "author");
|
||||
patchCol.patchLines = safeGetMultilineString(node, "content");
|
||||
gameEntry.patches[safeGetString(node, "crc", "default")] = patchCol;
|
||||
gameEntry.patches[crc] = patchCol;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue