Skip to content

Commit

Permalink
Fix losing scene modifications when renaming file
Browse files Browse the repository at this point in the history
Closes: godotengine#30436

When renaming/moving a file in the filesystem docker, changes on a scene that has dependencies on the file being renamed/moved are lost.

To resolve this, this patch saves the scenes that depend on the file first, to save its current state.
  • Loading branch information
codecustard committed Jul 16, 2019
1 parent efd5563 commit 2350af5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions editor/filesystem_dock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1298,7 +1298,7 @@ void FileSystemDock::_rename_operation_confirm() {
_try_move_item(to_rename, new_path, file_renames, folder_renames);

int current_tab = editor->get_current_tab();

_save_scenes_after_move(file_renames); // save scenes before updating
_update_dependencies_after_move(file_renames);
_update_resource_paths_after_move(file_renames);
_update_project_settings_after_move(file_renames);
Expand Down Expand Up @@ -1407,7 +1407,7 @@ void FileSystemDock::_move_operation_confirm(const String &p_to_path, bool overw

if (is_moved) {
int current_tab = editor->get_current_tab();

_save_scenes_after_move(file_renames); //save scenes before updating
_update_dependencies_after_move(file_renames);
_update_resource_paths_after_move(file_renames);
_update_project_settings_after_move(file_renames);
Expand Down

0 comments on commit 2350af5

Please sign in to comment.