瀏覽代碼

fix exporting of non-object types

karroffel 7 年之前
父節點
當前提交
cff59a572e
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      include/core/Godot.hpp

+ 1 - 1
include/core/Godot.hpp

@@ -357,7 +357,7 @@ void register_property(const char *name, P (T::*var), P default_value, godot_met
 	usage = (godot_property_usage_flags) ((int) usage | GODOT_PROPERTY_USAGE_SCRIPT_VARIABLE);
 
 	if (def_val.get_type() == Variant::OBJECT) {
-		Object *o = P::___get_from_variant(def_val);
+		Object *o = get_wrapper<Object>(def_val.operator godot_object*());
 		if (o && o->is_class("Resource")) {
 			hint = (godot_property_hint) ((int) hint | GODOT_PROPERTY_HINT_RESOURCE_TYPE);
 			hint_string = o->get_class();