From d00e1835121dc13f45a6e63e6c8097bbde3b14a8 Mon Sep 17 00:00:00 2001 From: Michael Alexsander Date: Fri, 24 Dec 2021 12:17:34 -0300 Subject: [PATCH] Fix undo/redo operations in Input Map --- editor/project_settings_editor.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/editor/project_settings_editor.cpp b/editor/project_settings_editor.cpp index 907c87c0a66..126f5a48960 100644 --- a/editor/project_settings_editor.cpp +++ b/editor/project_settings_editor.cpp @@ -258,7 +258,7 @@ void ProjectSettingsEditor::_device_input_add() { int idx = edit_idx; Dictionary old_val = ProjectSettings::get_singleton()->get(name); Dictionary action = old_val.duplicate(); - Array events = action["events"]; + Array events = action["events"].duplicate(); switch (add_type) { case INPUT_MOUSE_BUTTON: { @@ -383,7 +383,7 @@ void ProjectSettingsEditor::_press_a_key_confirm() { Dictionary old_val = ProjectSettings::get_singleton()->get(name); Dictionary action = old_val.duplicate(); - Array events = action["events"]; + Array events = action["events"].duplicate(); for (int i = 0; i < events.size(); i++) { Ref aie = events[i]; @@ -654,7 +654,7 @@ void ProjectSettingsEditor::_action_button_pressed(Object *p_obj, int p_column, Dictionary action = old_val.duplicate(); int idx = ti->get_metadata(0); - Array events = action["events"]; + Array events = action["events"].duplicate(); ERR_FAIL_INDEX(idx, events.size()); events.remove(idx); action["events"] = events;