You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
[Net] Add type check to GDScriptRPCCallable.
It will print an error when using an RPC defined on an object which does not extend Node.
This commit is contained in:
@@ -37,6 +37,7 @@
|
||||
class Node;
|
||||
|
||||
class GDScriptRPCCallable : public CallableCustom {
|
||||
Object *object = nullptr;
|
||||
Node *node = nullptr;
|
||||
StringName method;
|
||||
uint32_t h = 0;
|
||||
@@ -53,7 +54,7 @@ public:
|
||||
void call(const Variant **p_arguments, int p_argcount, Variant &r_return_value, Callable::CallError &r_call_error) const override;
|
||||
void rpc(int p_peer_id, const Variant **p_arguments, int p_argcount, Callable::CallError &r_call_error) const override;
|
||||
|
||||
GDScriptRPCCallable(Object *p_node, const StringName &p_method);
|
||||
GDScriptRPCCallable(Object *p_object, const StringName &p_method);
|
||||
virtual ~GDScriptRPCCallable() = default;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user