diff options
author | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2021-07-29 00:00:30 +0200 |
---|---|---|
committer | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2021-07-29 00:00:30 +0200 |
commit | fd5a140039bd5ced0d98189375d3164b8026f08b (patch) | |
tree | afc40e0a502a5b60305492709133959bb1f1baad /core | |
parent | 60eb508fbb9ddd30fa567f183f8f50b74af38cd6 (diff) |
[Net] Fix RPC ID encoding/decoding for Node methods.
Diffstat (limited to 'core')
-rw-r--r-- | core/io/multiplayer_api.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/io/multiplayer_api.cpp b/core/io/multiplayer_api.cpp index 80610e12cb..d4f09b2135 100644 --- a/core/io/multiplayer_api.cpp +++ b/core/io/multiplayer_api.cpp @@ -63,7 +63,7 @@ const MultiplayerAPI::RPCConfig _get_rpc_config(const Node *p_node, const String const Vector<MultiplayerAPI::RPCConfig> node_config = p_node->get_node_rpc_methods(); for (int i = 0; i < node_config.size(); i++) { if (node_config[i].name == p_method) { - r_id = ((uint16_t)i) & (1 << 15); + r_id = ((uint16_t)i) | (1 << 15); return node_config[i]; } } @@ -89,7 +89,7 @@ const MultiplayerAPI::RPCConfig _get_rpc_config_by_id(Node *p_node, uint16_t p_i config = p_node->get_script_instance()->get_rpc_methods(); } if (id < config.size()) { - return config[p_id]; + return config[id]; } return MultiplayerAPI::RPCConfig(); } |