summaryrefslogtreecommitdiff
path: root/core/func_ref.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/func_ref.cpp')
-rw-r--r--core/func_ref.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/core/func_ref.cpp b/core/func_ref.cpp
index ad29f4488d..4427d94d2a 100644
--- a/core/func_ref.cpp
+++ b/core/func_ref.cpp
@@ -31,7 +31,6 @@
#include "func_ref.h"
Variant FuncRef::call_func(const Variant **p_args, int p_argcount, Callable::CallError &r_error) {
-
if (id.is_null()) {
r_error.error = Callable::CallError::CALL_ERROR_INSTANCE_IS_NULL;
return Variant();
@@ -47,7 +46,6 @@ Variant FuncRef::call_func(const Variant **p_args, int p_argcount, Callable::Cal
}
Variant FuncRef::call_funcv(const Array &p_args) {
-
ERR_FAIL_COND_V(id.is_null(), Variant());
Object *obj = ObjectDB::get_instance(id);
@@ -58,29 +56,28 @@ Variant FuncRef::call_funcv(const Array &p_args) {
}
void FuncRef::set_instance(Object *p_obj) {
-
ERR_FAIL_NULL(p_obj);
id = p_obj->get_instance_id();
}
void FuncRef::set_function(const StringName &p_func) {
-
function = p_func;
}
bool FuncRef::is_valid() const {
- if (id.is_null())
+ if (id.is_null()) {
return false;
+ }
Object *obj = ObjectDB::get_instance(id);
- if (!obj)
+ if (!obj) {
return false;
+ }
return obj->has_method(function);
}
void FuncRef::_bind_methods() {
-
{
MethodInfo mi;
mi.name = "call_func";