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

fix: ensure last step is reset on quest shutdown #1862

Conversation

pajlada
Copy link
Contributor

@pajlada pajlada commented Nov 24, 2024

Previously, when a quest was shut down, we did not reset the lastStep variable in QuestManager

The lastStep variable is used to check if the highlight in the quest helper's side panel should change, and if we don't reset it, then stop & start the same quest, we'll have an active but unhighlighted step.
This PR prevents this.

The first commit consolidates all public QuestManager "shut down quest" functions into a single one to ensure I don't have to copy paste the lastStep logic elsewhere. It would be good to take an extra look at this to ensure I have missed anything where maybe the background helper should actually remain closed if a quest is shut down in a special way. I tested this to the best of my ability (starting/stopping the "Check all items" quest & other quests, while toggling the "Highlight all items" option on and off) and everything seems to work as expected.

this ensures `panel.updateHighlight` is always called once when the quest is started
@Zoinkwiz Zoinkwiz merged commit c296cfb into Zoinkwiz:master Nov 24, 2024
1 check passed
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.

2 participants