diff options
author | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2021-10-07 14:39:52 +0200 |
---|---|---|
committer | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2022-02-07 13:39:10 +0100 |
commit | 994638da4f78ad09a1ead707874654ae0d2a36db (patch) | |
tree | 6f900ffb7905dd3d6178de9b4322e88c916f7e12 /modules/gdscript/gdscript.cpp | |
parent | 1694626e03639cdf6879117e00772bdcc6bad594 (diff) | |
download | redot-engine-994638da4f78ad09a1ead707874654ae0d2a36db.tar.gz |
[Net] Implement GDScript custom RPC callable.
Diffstat (limited to 'modules/gdscript/gdscript.cpp')
-rw-r--r-- | modules/gdscript/gdscript.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp index a80874d785..58a788e255 100644 --- a/modules/gdscript/gdscript.cpp +++ b/modules/gdscript/gdscript.cpp @@ -43,6 +43,7 @@ #include "gdscript_cache.h" #include "gdscript_compiler.h" #include "gdscript_parser.h" +#include "gdscript_rpc_callable.h" #include "gdscript_warning.h" #ifdef TESTS_ENABLED @@ -1375,7 +1376,13 @@ bool GDScriptInstance::get(const StringName &p_name, Variant &r_ret) const { while (sl) { const Map<StringName, GDScriptFunction *>::Element *E = sl->member_functions.find(p_name); if (E) { - r_ret = Callable(this->owner, E->key()); + Multiplayer::RPCConfig config; + config.name = p_name; + if (sptr->rpc_functions.find(config) != -1) { + r_ret = Callable(memnew(GDScriptRPCCallable(this->owner, E->key()))); + } else { + r_ret = Callable(this->owner, E->key()); + } return true; //index found } sl = sl->_base; |