Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Committing a undo redo action without method causes an "INVALID_HISTORY" error #65729

Closed
MinusKube opened this issue Sep 13, 2022 · 1 comment · Fixed by #65754
Closed

Committing a undo redo action without method causes an "INVALID_HISTORY" error #65729

MinusKube opened this issue Sep 13, 2022 · 1 comment · Fixed by #65754

Comments

@MinusKube
Copy link
Contributor

Godot version

v4.0.alpha.custom_build [79b21e9]

System information

Windows 10

Issue description

Since #59564, when you create an undo redo action, then commit it without adding any method, it throws this error:
editor\editor_undo_redo_manager.cpp:221 - Condition "pending_action.history_id == INVALID_HISTORY" is true.

This happens in some cases, like here, when drag_modified_tiles is empty:

undo_redo->create_action(TTR("Create tiles"));
for (const Vector2i &E : drag_modified_tiles) {
undo_redo->add_do_method(tile_set_atlas_source, "create_tile", E);
undo_redo->add_undo_method(tile_set_atlas_source, "remove_tile", E);
}
undo_redo->commit_action(false);

This didn't happen before the merge of #59564.

Steps to reproduce

undo_redo->create_action(TTR("My Action"));
undo_redo->commit_action(false);

(or open a TileSet and try to create a tile where there's already one, this triggers the bug)

Minimal reproduction project

No response

@MinusKube
Copy link
Contributor Author

Maybe this is the expected behavior, in this case, that means some of the code needs to be modified to prevent the commit when there's no method, like adding a if (!drag_modified_tiles.is_empty()) in the issue example.

@Chaosus Chaosus added this to the 4.0 milestone Sep 13, 2022
@Chaosus Chaosus moved this to To Assess in 4.x Priority Issues Sep 13, 2022
@Chaosus Chaosus moved this from To Assess to Todo in 4.x Priority Issues Sep 13, 2022
Repository owner moved this from Todo to Done in 4.x Priority Issues Sep 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants