1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-22 10:42:36 +01:00

patches: Improve location logging for invalid note sequence

This commit is contained in:
Megamouse 2023-08-12 13:54:10 +02:00
parent d760e66fdb
commit f199ad7a42

View File

@ -378,7 +378,9 @@ bool patch_engine::load(patch_map& patches_map, const std::string& path, std::st
{ {
for (const auto note : notes_node) for (const auto note : notes_node)
{ {
if (note && note.IsScalar()) if (note)
{
if (note.IsScalar())
{ {
info.notes += note.Scalar(); info.notes += note.Scalar();
} }
@ -388,6 +390,12 @@ bool patch_engine::load(patch_map& patches_map, const std::string& path, std::st
is_valid = false; is_valid = false;
} }
} }
else
{
append_log_message(log_messages, fmt::format("Error: Skipping sequenced Note (patch: %s, key: %s, location: %s, file: %s)", description, main_key, get_yaml_node_location(notes_node), path), &patch_log.error);
is_valid = false;
}
}
} }
else else
{ {
@ -1752,9 +1760,9 @@ bool patch_engine::save_patches(const patch_map& patches, const std::string& pat
{ {
out << serial << YAML::BeginSeq; out << serial << YAML::BeginSeq;
for (const auto& app_version : app_versions) for (const auto& [app_version, patch_config] : app_versions)
{ {
out << app_version.first; out << app_version;
} }
out << YAML::EndSeq; out << YAML::EndSeq;
@ -1891,7 +1899,7 @@ patch_engine::patch_map patch_engine::load_config()
for (const auto pair : root) for (const auto pair : root)
{ {
const auto& hash = pair.first.Scalar(); const std::string& hash = pair.first.Scalar();
if (const auto yml_type = pair.second.Type(); yml_type != YAML::NodeType::Map) if (const auto yml_type = pair.second.Type(); yml_type != YAML::NodeType::Map)
{ {
@ -1901,7 +1909,7 @@ patch_engine::patch_map patch_engine::load_config()
for (const auto patch : pair.second) for (const auto patch : pair.second)
{ {
const auto& description = patch.first.Scalar(); const std::string& description = patch.first.Scalar();
if (const auto yml_type = patch.second.Type(); yml_type != YAML::NodeType::Map) if (const auto yml_type = patch.second.Type(); yml_type != YAML::NodeType::Map)
{ {
@ -1911,7 +1919,7 @@ patch_engine::patch_map patch_engine::load_config()
for (const auto title_node : patch.second) for (const auto title_node : patch.second)
{ {
const auto& title = title_node.first.Scalar(); const std::string& title = title_node.first.Scalar();
if (const auto yml_type = title_node.second.Type(); yml_type != YAML::NodeType::Map) if (const auto yml_type = title_node.second.Type(); yml_type != YAML::NodeType::Map)
{ {
@ -1921,7 +1929,7 @@ patch_engine::patch_map patch_engine::load_config()
for (const auto serial_node : title_node.second) for (const auto serial_node : title_node.second)
{ {
const auto& serial = serial_node.first.Scalar(); const std::string& serial = serial_node.first.Scalar();
if (const auto yml_type = serial_node.second.Type(); yml_type != YAML::NodeType::Map) if (const auto yml_type = serial_node.second.Type(); yml_type != YAML::NodeType::Map)
{ {