summaryrefslogtreecommitdiff
path: root/core/variant_call.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/variant_call.cpp')
-rw-r--r--core/variant_call.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/core/variant_call.cpp b/core/variant_call.cpp
index 8fbccc87ae..e0ae7e2114 100644
--- a/core/variant_call.cpp
+++ b/core/variant_call.cpp
@@ -1012,6 +1012,32 @@ Variant Variant::construct(const Variant::Type p_type,const Variant** p_args,int
return Variant();
}
+
+bool Variant::has_method(const StringName& p_method) const {
+
+
+ if (type==OBJECT) {
+ Object *obj = operator Object*();
+ if (!obj)
+ return false;
+#ifdef DEBUG_ENABLED
+ if (ScriptDebugger::get_singleton()) {
+ if (ObjectDB::instance_validate(obj)) {
+#endif
+ return obj->has_method(p_method);
+#ifdef DEBUG_ENABLED
+
+ }
+ }
+#endif
+ }
+
+
+ const _VariantCall::TypeFunc &fd = _VariantCall::type_funcs[type];
+ return fd.functions.has(p_method);
+
+}
+
void Variant::get_method_list(List<MethodInfo> *p_list) const {