Fix Script Classes not instancing with custom name.

This commit is contained in:
Will Nations 2018-08-30 16:00:04 -05:00
parent 2ba42b7095
commit dee0ee749d
1 changed files with 5 additions and 1 deletions

View File

@ -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 {