From 3056c4bd5acc4b5eda71303bf349e0d4f94a89c8 Mon Sep 17 00:00:00 2001 From: sheepandshepherd Date: Mon, 21 Oct 2019 17:44:56 +0200 Subject: Expose cast_to to GDNative for dynamic casts --- core/class_db.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'core') diff --git a/core/class_db.h b/core/class_db.h index 4129a74147..54f3e9e107 100644 --- a/core/class_db.h +++ b/core/class_db.h @@ -114,6 +114,7 @@ public: APIType api; ClassInfo *inherits_ptr; + void *class_ptr; HashMap method_map; HashMap constant_map; HashMap > enum_map; @@ -177,6 +178,7 @@ public: ERR_FAIL_COND(!t); t->creation_func = &creator; t->exposed = true; + t->class_ptr = T::get_class_ptr_static(); T::register_custom_data_to_otdb(); } @@ -188,6 +190,7 @@ public: ClassInfo *t = classes.getptr(T::get_class_static()); ERR_FAIL_COND(!t); t->exposed = true; + t->class_ptr = T::get_class_ptr_static(); //nothing } @@ -206,6 +209,7 @@ public: ERR_FAIL_COND(!t); t->creation_func = &_create_ptr_func; t->exposed = true; + t->class_ptr = T::get_class_ptr_static(); T::register_custom_data_to_otdb(); } -- cgit v1.2.3