Merge pull request #30026 from akien-mga/fix-undo-convert-cpuparticles

Fix undo references for conversion to CPUParticles
This commit is contained in:
Rémi Verschelde 2019-06-24 12:40:23 +02:00 committed by GitHub
commit 1cb2b682ab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -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;

View file

@ -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;