From fd5a140039bd5ced0d98189375d3164b8026f08b Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Thu, 29 Jul 2021 00:00:30 +0200 Subject: [Net] Fix RPC ID encoding/decoding for Node methods. --- core/io/multiplayer_api.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core/io/multiplayer_api.cpp') 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 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(); } -- cgit v1.2.3