diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-01-31 13:20:04 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-01-31 13:20:04 +0100 |
commit | e1648b3327431a09cc9498663fac483275eb711d (patch) | |
tree | 820eef8ec10cdfa1b5a0478ed9813ea25d600c33 /editor | |
parent | e768e02b789d2d0afbbc4f775d8cd8e807b1d79c (diff) | |
parent | 79897dd5bc75bb0553a48fd36537454f5ad95764 (diff) |
Merge pull request #72445 from reduz/restore-script-class-cache-if-removed
Restore script class cache if removed
Diffstat (limited to 'editor')
-rw-r--r-- | editor/editor_file_system.cpp | 5 | ||||
-rw-r--r-- | editor/export/editor_export_platform.cpp | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp index ef33b82390..4d0ef3fe8d 100644 --- a/editor/editor_file_system.cpp +++ b/editor/editor_file_system.cpp @@ -1591,6 +1591,11 @@ void EditorFileSystem::_update_script_classes() { void EditorFileSystem::_update_pending_script_classes() { if (!update_script_paths.is_empty()) { _update_script_classes(); + } else { + // In case the class cache file was removed somehow, regenerate it. + if (ScriptServer::has_global_classes() && !FileAccess::exists(ScriptServer::get_global_class_cache_file_path())) { + ScriptServer::save_global_classes(); + } } } diff --git a/editor/export/editor_export_platform.cpp b/editor/export/editor_export_platform.cpp index fe67813d65..a46484bb0e 100644 --- a/editor/export/editor_export_platform.cpp +++ b/editor/export/editor_export_platform.cpp @@ -814,7 +814,7 @@ Error EditorExportPlatform::export_project_files(const Ref<EditorExportPreset> & HashSet<String> paths; Vector<String> path_remaps; - paths.insert(ProjectSettings::get_singleton()->get_project_data_path().path_join("global_script_class_cache.cfg")); + paths.insert(ProjectSettings::get_singleton()->get_global_class_list_path()); if (p_preset->get_export_filter() == EditorExportPreset::EXPORT_ALL_RESOURCES) { //find stuff _export_find_resources(EditorFileSystem::get_singleton()->get_filesystem(), paths); |