diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-06-24 12:40:23 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-24 12:40:23 +0200 |
commit | 1cb2b682ab72e2c457b54fdf63628bc1db126c7d (patch) | |
tree | a223114a066af1f2a2b7a6f32c5b82bf235f7596 | |
parent | 338c553732a512e9a36bc889532117b5fd3399ad (diff) | |
parent | ed504753f45c1dd4a5bedd0902e4e8c4d1f5b6bc (diff) |
Merge pull request #30026 from akien-mga/fix-undo-convert-cpuparticles
Fix undo references for conversion to CPUParticles
-rw-r--r-- | editor/plugins/particles_2d_editor_plugin.cpp | 4 | ||||
-rw-r--r-- | editor/plugins/particles_editor_plugin.cpp | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/editor/plugins/particles_2d_editor_plugin.cpp b/editor/plugins/particles_2d_editor_plugin.cpp index 6fabdc93c6..0147ce2a4e 100644 --- a/editor/plugins/particles_2d_editor_plugin.cpp +++ b/editor/plugins/particles_2d_editor_plugin.cpp @@ -96,9 +96,9 @@ void Particles2DEditorPlugin::_menu_callback(int p_idx) { UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo(); ur->create_action(TTR("Convert to CPUParticles")); ur->add_do_method(EditorNode::get_singleton()->get_scene_tree_dock(), "replace_node", particles, cpu_particles, true, false); - ur->add_do_reference(particles); + ur->add_do_reference(cpu_particles); ur->add_undo_method(EditorNode::get_singleton()->get_scene_tree_dock(), "replace_node", cpu_particles, particles, false, false); - ur->add_undo_reference(this); + ur->add_undo_reference(particles); ur->commit_action(); } break; diff --git a/editor/plugins/particles_editor_plugin.cpp b/editor/plugins/particles_editor_plugin.cpp index 3f4f66a26d..ddcd332a1d 100644 --- a/editor/plugins/particles_editor_plugin.cpp +++ b/editor/plugins/particles_editor_plugin.cpp @@ -315,9 +315,9 @@ void ParticlesEditor::_menu_option(int p_option) { UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo(); ur->create_action(TTR("Convert to CPUParticles")); ur->add_do_method(EditorNode::get_singleton()->get_scene_tree_dock(), "replace_node", node, cpu_particles, true, false); - ur->add_do_reference(node); + ur->add_do_reference(cpu_particles); ur->add_undo_method(EditorNode::get_singleton()->get_scene_tree_dock(), "replace_node", cpu_particles, node, false, false); - ur->add_undo_reference(this); + ur->add_undo_reference(node); ur->commit_action(); } break; |