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

UndoRedo: Fix MERGE_ALL commit from repeating actions #85390

Merged
merged 1 commit into from
Mar 6, 2024

Conversation

TheSofox
Copy link
Contributor

Fixes #26118

Committing an UNDO action will run the action. This is fine if it's set to not merge or only merge the ends, but with MERGE_ALL it meant that the action could be merged into previous actions, then the operations from ALL the merged actions would be run, instead of from the most recent action.

This pull request fixes this by keeping a record (merge_total) of the amount of operations that are in the current action that the new action is being merged into. Then, when the action is committed. This variable is used to skip over operations until we get to the ones that only the newest action added.

@TheSofox TheSofox requested a review from a team as a code owner November 26, 2023 17:18
@TheSofox
Copy link
Contributor Author

TheSofox commented Mar 5, 2024

I've added Unit Tests that prove the bug has been fixed and test one or two other parts of UndoRedo for good measure.

@akien-mga akien-mga requested a review from KoBeWi March 5, 2024 15:01
@akien-mga akien-mga changed the title Fixed MERGE_ALL commit from repeating actions UndoRedo: Fix MERGE_ALL commit from repeating actions Mar 5, 2024
@akien-mga akien-mga merged commit d082ce9 into godotengine:master Mar 6, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Possible bug with UndoRedo's MERGE_ALL mode
4 participants