Interpret negative values in game patches

This commit is contained in:
Timo654 2022-04-18 00:07:10 +03:00 committed by Ivan
parent b5db0d0397
commit afae58b231
2 changed files with 6 additions and 0 deletions

View file

@ -496,6 +496,11 @@ bool patch_engine::add_patch_data(YAML::Node node, patch_info& info, u32 modifie
default: default:
{ {
p_data.value.long_value = get_yaml_node_value<u64>(value_node, error_message); p_data.value.long_value = get_yaml_node_value<u64>(value_node, error_message);
if (error_message.find("bad conversion") != std::string::npos)
{
error_message = "";
p_data.value.long_value = get_yaml_node_value<s64>(value_node, error_message);
}
break; break;
} }
} }

View file

@ -78,5 +78,6 @@ std::string get_yaml_node_location(YAML::Node node)
template u32 get_yaml_node_value<u32>(YAML::Node, std::string&); template u32 get_yaml_node_value<u32>(YAML::Node, std::string&);
template u64 get_yaml_node_value<u64>(YAML::Node, std::string&); template u64 get_yaml_node_value<u64>(YAML::Node, std::string&);
template s64 get_yaml_node_value<s64>(YAML::Node, std::string&);
template f64 get_yaml_node_value<f64>(YAML::Node, std::string&); template f64 get_yaml_node_value<f64>(YAML::Node, std::string&);
template cheat_info get_yaml_node_value<cheat_info>(YAML::Node, std::string&); template cheat_info get_yaml_node_value<cheat_info>(YAML::Node, std::string&);