Skip to content

Commit

Permalink
Merge pull request #78827 from Rindbee/fix-history-mismatch
Browse files Browse the repository at this point in the history
Fix history mismatch
  • Loading branch information
YuriSizov committed Jul 26, 2023
2 parents 7c20487 + 28db5e7 commit bc0e646
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions editor/editor_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1984,6 +1984,9 @@ void EditorNode::_dialog_action(String p_file) {

if (scene_idx != -1) {
_discard_changes();
} else {
// Update the path of the edited scene to ensure later do/undo action history matches.
editor_data.set_scene_path(editor_data.get_edited_scene(), p_file);
}
}

Expand Down
4 changes: 2 additions & 2 deletions editor/plugins/tiles/tile_set_atlas_source_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2138,7 +2138,7 @@ void TileSetAtlasSourceEditor::_undo_redo_inspector_callback(Object *p_undo_redo
Ref<TileSetAtlasSource> atlas_source = atlas_source_proxy->get_edited();
ERR_FAIL_COND(!atlas_source.is_valid());

UndoRedo *internal_undo_redo = undo_redo_man->get_history_for_object(atlas_source.ptr()).undo_redo;
UndoRedo *internal_undo_redo = undo_redo_man->get_history_for_object(atlas_source_proxy).undo_redo;
internal_undo_redo->start_force_keep_in_merge_ends();

PackedVector2Array arr;
Expand All @@ -2162,7 +2162,7 @@ void TileSetAtlasSourceEditor::_undo_redo_inspector_callback(Object *p_undo_redo
String prefix = vformat("%d:%d/", coords.x, coords.y);
for (PropertyInfo pi : properties) {
if (pi.name.begins_with(prefix)) {
ADD_UNDO(atlas_source.ptr(), pi.name);
ADD_UNDO(atlas_source_proxy, pi.name);
}
}
}
Expand Down

0 comments on commit bc0e646

Please sign in to comment.