Check if history exists before discarding

This commit is contained in:
kobewi
2024-02-05 17:42:37 +01:00
parent f427d2f0d3
commit 808f4e8cb9
3 changed files with 8 additions and 1 deletions

View File

@ -375,6 +375,10 @@ bool EditorUndoRedoManager::has_redo() {
return false;
}
bool EditorUndoRedoManager::has_history(int p_idx) const {
return history_map.has(p_idx);
}
void EditorUndoRedoManager::clear_history(bool p_increase_version, int p_idx) {
if (p_idx != INVALID_HISTORY) {
History &history = get_or_create_history(p_idx);