diff options
Diffstat (limited to 'core/variant/callable.cpp')
-rw-r--r-- | core/variant/callable.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/core/variant/callable.cpp b/core/variant/callable.cpp index c6a67f01d5..27792ce111 100644 --- a/core/variant/callable.cpp +++ b/core/variant/callable.cpp @@ -114,8 +114,9 @@ ObjectID Callable::get_object_id() const { } StringName Callable::get_method() const { - ERR_FAIL_COND_V_MSG(is_custom(), StringName(), - vformat("Can't get method on CallableCustom \"%s\".", operator String())); + if (is_custom()) { + return get_custom()->get_method(); + } return method; } @@ -310,6 +311,10 @@ Callable::~Callable() { } } +StringName CallableCustom::get_method() const { + ERR_FAIL_V_MSG(StringName(), vformat("Can't get method on CallableCustom \"%s\".", get_as_text())); +} + void CallableCustom::rpc(int p_peer_id, const Variant **p_arguments, int p_argcount, Callable::CallError &r_call_error) const { r_call_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; r_call_error.argument = 0; |