mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-01-19 04:13:24 +00:00
Floats may look like ints in json.
This commit is contained in:
parent
95f09bf393
commit
7772433257
@ -81,8 +81,13 @@ float json_value::getFloat(const char *child_name) const {
|
||||
|
||||
float json_value::getFloat(const char *child_name, float default_value) const {
|
||||
const json_value *val = get(child_name, JSON_FLOAT);
|
||||
if (!val)
|
||||
return default_value;
|
||||
if (!val) {
|
||||
// Let's try int.
|
||||
val = get(child_name, JSON_INT);
|
||||
if (!val)
|
||||
return default_value;
|
||||
return val->int_value;
|
||||
}
|
||||
return val->float_value;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user