diff options
author | Juan Linietsky <reduzio@gmail.com> | 2018-01-05 17:29:55 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2018-01-05 17:30:29 -0300 |
commit | bb2341e813a14f8e4c272765c4db9584b6c5c9b1 (patch) | |
tree | 343bf9c8545e52d90c408bb7f03119679238aada | |
parent | db49f35ab8d2bbcf5b97a58b8a2eff064b942881 (diff) |
Make sure .import folder exists before importing, in case user deleted it manually. Fixes #15315
-rw-r--r-- | editor/editor_file_system.cpp | 13 | ||||
-rw-r--r-- | editor/import/resource_importer_wav.cpp | 1 |
2 files changed, 13 insertions, 1 deletions
diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp index eff2cf9ce5..dca32d7492 100644 --- a/editor/editor_file_system.cpp +++ b/editor/editor_file_system.cpp @@ -1509,6 +1509,19 @@ void EditorFileSystem::_reimport_file(const String &p_file) { void EditorFileSystem::reimport_files(const Vector<String> &p_files) { + { //check that .import folder exists + DirAccess *da = DirAccess::open("res://"); + if (da->change_dir(".import") != OK) { + Error err = da->make_dir(".import"); + if (err) { + memdelete(da); + ERR_EXPLAIN("Failed to create 'res://.import' folder."); + ERR_FAIL_COND(err != OK); + } + } + memdelete(da); + } + importing = true; EditorProgress pr("reimport", TTR("(Re)Importing Assets"), p_files.size()); diff --git a/editor/import/resource_importer_wav.cpp b/editor/import/resource_importer_wav.cpp index f73c7ebfd8..12aa0bb33c 100644 --- a/editor/import/resource_importer_wav.cpp +++ b/editor/import/resource_importer_wav.cpp @@ -389,7 +389,6 @@ Error ResourceImporterWAV::import(const String &p_source_file, const String &p_s new_data.resize((last - first + 1) * format_channels); for (int i = first * format_channels; i < (last + 1) * format_channels; i++) { new_data[i - first * format_channels] = data[i]; - setc++; } data = new_data; |