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

Don't Execute Paused Node Twice #52

Merged
merged 2 commits into from
Sep 23, 2021
Merged

Conversation

brwarner
Copy link
Contributor

We have a subtle bug where the present, paused on node is executed twice, once upon arrival, and once upon leaving.

This is caused by the logic in our UpdateAvailableBranches code. It always adds the current node to the start of every available branch. When advancing along a branch, we execute each node in the its path. Since the current node was previously the last node in the path of a branch, and is now the first node in the next branch, it's executed twice.

Normally, this was not a problem since only OutputPin and Instruction nodes have an implementation of Execute and usually Instruction nodes are not paused at. However, if the user does set Instruction in their Pause On setting on the flow player, they'll see this bug.

The original behavior of adding the present node to the start of each branch is maintained whenever we reset the current cursor, as we presumably want to make sure we execute the node we begin at.

@brwarner
Copy link
Contributor Author

Fixed a few bugs when setting an Instruction as the start node. Still need to do some more testing as this is a higher risk change.

@brwarner brwarner marked this pull request as ready for review September 23, 2021 17:17
@brwarner brwarner force-pushed the double-instruction-execution branch from eac0994 to 047d983 Compare September 23, 2021 20:23
@brwarner brwarner changed the title Don't Add Current Node to Branch Paths Don't Execute Paused Node Twice Sep 23, 2021
@brwarner brwarner merged commit 34f01fd into development Sep 23, 2021
@brwarner brwarner deleted the double-instruction-execution branch September 23, 2021 20:32
@brwarner brwarner added this to the v1.3.1 milestone Oct 8, 2021
@brwarner brwarner removed the 1.3.1 label Oct 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When "PauseOn" is set to "Instruction", "UArticyScriptInstruction::Execute" is executed twice.
1 participant