From 22b1cc765aa22c0b81954520ef783c2b69a79357 Mon Sep 17 00:00:00 2001 From: Megamouse Date: Thu, 11 Jun 2020 21:49:32 +0200 Subject: [PATCH] patch manager: hotfix for legacy patches Assignment of invalid YAML nodes is not possible after all --- Utilities/bin_patch.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Utilities/bin_patch.cpp b/Utilities/bin_patch.cpp index 95070eae5a..9648840adc 100644 --- a/Utilities/bin_patch.cpp +++ b/Utilities/bin_patch.cpp @@ -262,9 +262,14 @@ void patch_engine::add_patch_data(YAML::Node node, patch_info& info, u32 modifie if (const auto yml_type = addr_node.Type(); yml_type == YAML::NodeType::Scalar) { const auto anchor = addr_node.Scalar(); - patch_log.warning("Incorrect anchor syntax found in legacy patch: %s (key: %s)", anchor, info.hash); + const auto anchor_node = root[anchor]; - if (!(addr_node = root[anchor])) + if (anchor_node) + { + addr_node = anchor_node; + patch_log.warning("Incorrect anchor syntax found in legacy patch: %s (key: %s)", anchor, info.hash); + } + else { patch_log.error("Anchor not found in legacy patch: %s (key: %s)", anchor, info.hash); return;