From afae58b23122524cdef99140ca54be9a41364e89 Mon Sep 17 00:00:00 2001 From: Timo654 <41972888+Timo654@users.noreply.github.com> Date: Mon, 18 Apr 2022 00:07:10 +0300 Subject: [PATCH] Interpret negative values in game patches --- Utilities/bin_patch.cpp | 5 +++++ rpcs3/util/yaml.cpp | 1 + 2 files changed, 6 insertions(+) diff --git a/Utilities/bin_patch.cpp b/Utilities/bin_patch.cpp index b61ee7a3d7..75b19d7446 100644 --- a/Utilities/bin_patch.cpp +++ b/Utilities/bin_patch.cpp @@ -496,6 +496,11 @@ bool patch_engine::add_patch_data(YAML::Node node, patch_info& info, u32 modifie default: { p_data.value.long_value = get_yaml_node_value(value_node, error_message); + if (error_message.find("bad conversion") != std::string::npos) + { + error_message = ""; + p_data.value.long_value = get_yaml_node_value(value_node, error_message); + } break; } } diff --git a/rpcs3/util/yaml.cpp b/rpcs3/util/yaml.cpp index ea52140e2d..a8f11cfdc7 100644 --- a/rpcs3/util/yaml.cpp +++ b/rpcs3/util/yaml.cpp @@ -78,5 +78,6 @@ std::string get_yaml_node_location(YAML::Node node) template u32 get_yaml_node_value(YAML::Node, std::string&); template u64 get_yaml_node_value(YAML::Node, std::string&); +template s64 get_yaml_node_value(YAML::Node, std::string&); template f64 get_yaml_node_value(YAML::Node, std::string&); template cheat_info get_yaml_node_value(YAML::Node, std::string&);