diff options
Diffstat (limited to 'editor/create_dialog.cpp')
-rw-r--r-- | editor/create_dialog.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp index b28fe400e6..3a63100012 100644 --- a/editor/create_dialog.cpp +++ b/editor/create_dialog.cpp @@ -5,8 +5,8 @@ /* GODOT ENGINE */ /* https://godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */ +/* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -408,15 +408,15 @@ String CreateDialog::get_selected_type() { return selected->get_text(0); } -Object *CreateDialog::instance_selected() { +Variant CreateDialog::instance_selected() { TreeItem *selected = search_options->get_selected(); if (!selected) { - return nullptr; + return Variant(); } Variant md = selected->get_metadata(0); - Object *obj = nullptr; + Variant obj; if (md.get_type() != Variant::NIL) { String custom = md; if (ScriptServer::is_global_class(custom)) { @@ -434,13 +434,13 @@ Object *CreateDialog::instance_selected() { // Check if any Object-type property should be instantiated. List<PropertyInfo> pinfo; - obj->get_property_list(&pinfo); + ((Object *)obj)->get_property_list(&pinfo); for (List<PropertyInfo>::Element *E = pinfo.front(); E; E = E->next()) { PropertyInfo pi = E->get(); if (pi.type == Variant::OBJECT && pi.usage & PROPERTY_USAGE_EDITOR_INSTANTIATE_OBJECT) { Object *prop = ClassDB::instance(pi.class_name); - obj->set(pi.name, prop); + ((Object *)obj)->set(pi.name, prop); } } |