_get return type fix

This commit is contained in:
Ramesh Ravone 2017-07-18 21:09:46 +05:30
parent 0afa77a8a2
commit 826c51c70e
No known key found for this signature in database
GPG key ID: 90B471D9AC10312A
2 changed files with 3 additions and 1 deletions

View file

@ -1723,7 +1723,7 @@ void Object::_bind_methods() {
BIND_VMETHOD(MethodInfo("_set", PropertyInfo(Variant::STRING, "property"), PropertyInfo(Variant::NIL, "value")));
#ifdef TOOLS_ENABLED
MethodInfo miget("_get", PropertyInfo(Variant::STRING, "property"));
miget.return_val.name = "var";
miget.return_val.name = "Variant";
BIND_VMETHOD(miget);
MethodInfo plget("_get_property_list");

View file

@ -268,6 +268,8 @@ List<ClassAPI> generate_c_api_classes() {
method_api.method_name = method_api.method_name.get_slice(":", 0);
} else if (m->get().return_val.type != Variant::NIL) {
method_api.return_type = m->get().return_val.hint == PROPERTY_HINT_RESOURCE_TYPE ? m->get().return_val.hint_string : Variant::get_type_name(m->get().return_val.type);
} else if (m->get().return_val.name != "") {
method_api.return_type = m->get().return_val.name;
} else {
method_api.return_type = "void";
}