Browse Source

fix GDNative binding generation for object types

karroffel 6 years ago
parent
commit
197d642014
1 changed files with 3 additions and 1 deletions
  1. 3 1
      modules/gdnative/nativescript/api_generator.cpp

+ 3 - 1
modules/gdnative/nativescript/api_generator.cpp

@@ -279,7 +279,7 @@ List<ClassAPI> generate_c_api_classes() {
 				MethodInfo &method_info = m->get();
 				MethodInfo &method_info = m->get();
 
 
 				//method name
 				//method name
-				method_api.method_name = m->get().name;
+				method_api.method_name = method_info.name;
 				//method return type
 				//method return type
 				if (method_api.method_name.find(":") != -1) {
 				if (method_api.method_name.find(":") != -1) {
 					method_api.return_type = method_api.method_name.get_slice(":", 1);
 					method_api.return_type = method_api.method_name.get_slice(":", 1);
@@ -321,6 +321,8 @@ List<ClassAPI> generate_c_api_classes() {
 						arg_type = arg_info.hint_string;
 						arg_type = arg_info.hint_string;
 					} else if (arg_info.type == Variant::NIL) {
 					} else if (arg_info.type == Variant::NIL) {
 						arg_type = "Variant";
 						arg_type = "Variant";
+					} else if (arg_info.type == Variant::OBJECT) {
+						arg_type = arg_info.class_name;
 					} else {
 					} else {
 						arg_type = Variant::get_type_name(arg_info.type);
 						arg_type = Variant::get_type_name(arg_info.type);
 					}
 					}