diff options
Diffstat (limited to 'editor/filesystem_dock.cpp')
-rw-r--r-- | editor/filesystem_dock.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index fcf3e49a91..e8cf081320 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -1898,7 +1898,7 @@ void FileSystemDock::_file_option(int p_option, const Vector<String> &p_selected } void FileSystemDock::_resource_created() { - Object *c = new_resource_dialog->instance_selected(); + Variant c = new_resource_dialog->instance_selected(); ERR_FAIL_COND(!c); Resource *r = Object::cast_to<Resource>(c); @@ -1912,17 +1912,14 @@ void FileSystemDock::_resource_created() { memdelete(node); } - REF res(r); - editor->push_item(c); - - RES current_res = RES(r); + editor->push_item(r); String fpath = path; if (!fpath.ends_with("/")) { fpath = fpath.get_base_dir(); } - editor->save_resource_as(current_res, fpath); + editor->save_resource_as(RES(r), fpath); } void FileSystemDock::_search_changed(const String &p_text, const Control *p_from) { |