mirror of
https://github.com/godotengine/godot.git
synced 2025-01-22 10:32:54 -05:00
Jsonrpc: Convert ids to int if they are int by value
This commit is contained in:
parent
efa144396d
commit
9db804f72e
1 changed files with 5 additions and 0 deletions
|
@ -122,6 +122,11 @@ Variant JSONRPC::process_action(const Variant &p_action, bool p_process_arr_elem
|
|||
Variant id;
|
||||
if (dict.has("id")) {
|
||||
id = dict["id"];
|
||||
|
||||
// Account for implementations that discern between int and float on the json serialization level, by using an int if there is a .0 fraction. See #100914
|
||||
if (id.get_type() == Variant::FLOAT && id.operator float() == (float)(id.operator int())) {
|
||||
id = id.operator int();
|
||||
}
|
||||
}
|
||||
|
||||
if (object == nullptr || !object->has_method(method)) {
|
||||
|
|
Loading…
Reference in a new issue