diff options
Diffstat (limited to 'core/method_bind.h')
-rw-r--r-- | core/method_bind.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/core/method_bind.h b/core/method_bind.h index 7bb75e778f..1860d227f7 100644 --- a/core/method_bind.h +++ b/core/method_bind.h @@ -5,8 +5,8 @@ /* GODOT ENGINE */ /* https://godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */ +/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -344,7 +344,7 @@ public: return (instance->*call_method)(p_args, p_arg_count, r_error); } - void set_method_info(const MethodInfo &p_info) { + void set_method_info(const MethodInfo &p_info, bool p_return_nil_is_variant) { set_argument_count(p_info.arguments.size()); #ifdef DEBUG_METHODS_ENABLED @@ -364,7 +364,9 @@ public: } argument_types = at; arguments = p_info; - arguments.return_val.usage |= PROPERTY_USAGE_NIL_IS_VARIANT; + if (p_return_nil_is_variant) { + arguments.return_val.usage |= PROPERTY_USAGE_NIL_IS_VARIANT; + } #endif } @@ -387,11 +389,11 @@ public: }; template <class T> -MethodBind *create_vararg_method_bind(Variant (T::*p_method)(const Variant **, int, Variant::CallError &), const MethodInfo &p_info) { +MethodBind *create_vararg_method_bind(Variant (T::*p_method)(const Variant **, int, Variant::CallError &), const MethodInfo &p_info, bool p_return_nil_is_variant) { MethodBindVarArg<T> *a = memnew((MethodBindVarArg<T>)); a->set_method(p_method); - a->set_method_info(p_info); + a->set_method_info(p_info, p_return_nil_is_variant); return a; } |