summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorWill Nations <willnationsdev@gmail.com>2018-08-30 16:00:04 -0500
committerWill Nations <willnationsdev@gmail.com>2018-08-30 16:01:39 -0500
commitdee0ee749d8211d862d73a005af3e4ab39e63892 (patch)
tree6c41ef64fc0e11b7e137c02a28928b37b58cf869 /editor
parent2ba42b709541928aaaa0312077d5b9cacdb696a5 (diff)
Fix Script Classes not instancing with custom name.
Diffstat (limited to 'editor')
-rw-r--r--editor/create_dialog.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp
index 8433f4ff7b..fd607e5b63 100644
--- a/editor/create_dialog.cpp
+++ b/editor/create_dialog.cpp
@@ -497,7 +497,11 @@ Object *CreateDialog::instance_selected() {
if (custom != String()) {
if (ScriptServer::is_global_class(custom)) {
- return EditorNode::get_editor_data().script_class_instance(custom);
+ Object *obj = EditorNode::get_editor_data().script_class_instance(custom);
+ Node *n = Object::cast_to<Node>(obj);
+ if (n)
+ n->set_name(custom);
+ return obj;
}
return EditorNode::get_editor_data().instance_custom_type(selected->get_text(0), custom);
} else {