aboutsummaryrefslogtreecommitdiff
path: root/modules/mono/csharp_script.cpp
diff options
context:
space:
mode:
authorIgnacio Etcheverry2017-10-09 23:50:06 +0200
committerIgnacio Etcheverry2017-10-09 23:50:06 +0200
commit9b6f65af82d02d1ec92de1d2d6250884de20cbf3 (patch)
treeda74112989c7291ff69ef1ef97b7f57e76a0020b /modules/mono/csharp_script.cpp
parent0c2e882210f8848475f7d9547af50a202f53a110 (diff)
downloadgodot-9b6f65af82d02d1ec92de1d2d6250884de20cbf3.tar.gz
godot-9b6f65af82d02d1ec92de1d2d6250884de20cbf3.tar.zst
godot-9b6f65af82d02d1ec92de1d2d6250884de20cbf3.zip
Diffstat (limited to 'modules/mono/csharp_script.cpp')
-rw-r--r--modules/mono/csharp_script.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp
index 6f9e7f49d..ee36a4987 100644
--- a/modules/mono/csharp_script.cpp
+++ b/modules/mono/csharp_script.cpp
@@ -654,6 +654,13 @@ void *CSharpLanguage::alloc_instance_binding_data(Object *p_object) {
StringName type_name = p_object->get_class_name();
+ // ¯\_(ツ)_/¯
+ const ClassDB::ClassInfo *classinfo = ClassDB::classes.getptr(type_name);
+ while (classinfo && !classinfo->exposed)
+ classinfo = classinfo->inherits_ptr;
+ ERR_FAIL_NULL_V(classinfo, NULL);
+ type_name = classinfo->name;
+
GDMonoClass *type_class = GDMonoUtils::type_get_proxy_class(type_name);
ERR_FAIL_NULL_V(type_class, NULL);