mirror of
https://github.com/N64Recomp/N64ModernRuntime.git
synced 2026-06-25 17:33:10 +00:00
query by value to allow signed/unsigned conversion
This commit is contained in:
parent
03c3bd8d08
commit
4f0676e606
1 changed files with 4 additions and 6 deletions
|
|
@ -466,22 +466,20 @@ recomp::mods::ModOpenError parse_manifest_config_schema_option(const nlohmann::j
|
|||
|
||||
auto precision = config_schema_json.find(config_schema_precision_key);
|
||||
if (precision != config_schema_json.end()) {
|
||||
int64_t precision_int64;
|
||||
if (get_to<int64_t>(*precision, precision_int64)) {
|
||||
option_number.precision = precision_int64;
|
||||
}
|
||||
else {
|
||||
if (!precision->is_number()) {
|
||||
error_param = config_schema_precision_key;
|
||||
return recomp::mods::ModOpenError::IncorrectConfigSchemaType;
|
||||
}
|
||||
option_number.precision = precision->template get<int64_t>();
|
||||
}
|
||||
|
||||
auto percent = config_schema_json.find(config_schema_percent_key);
|
||||
if (percent != config_schema_json.end()) {
|
||||
if (!get_to<bool>(*percent, option_number.percent)) {
|
||||
if (!percent->is_boolean()) {
|
||||
error_param = config_schema_percent_key;
|
||||
return recomp::mods::ModOpenError::IncorrectConfigSchemaType;
|
||||
}
|
||||
option_number.percent = percent->template get<bool>();
|
||||
}
|
||||
|
||||
auto default_value = config_schema_json.find(config_schema_default_key);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue