Don't reset incomplete missions after skills training #38632
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
SUMMARY: Bugfixes "Don't reset incomplete missions after skills training"
Purpose of change
Partial fix for #34789. Fixes #23824. There was a bug where getting skills training from an NPC who had given you a mission, even if not in the context of the mission completion reward, would clear the mission. This PR fixes that by only clearing missions given in training if the mission is complete.
Describe the solution
Added a check before the clear_mission call to only do that if the mission is complete.
Describe alternatives you've considered
A bigger re-work of how mission completion happens.
Testing
Generated a bunch of NPCs and had them give me quests. Previously, asking for training would reset the mission. Now, it does not.
Additional context
I don't think know that this a complete fix for #34789 because that bug's original description did not have a reliable repro. But it at least resolves the bug related to receiving training while a quest is in progress.
Even though they seem somewhat related, I don't believe this bug was the cause of #38325. This bug causes the mission-giver to flip over to the next mission after getting training - you can't complete the first mission you got, but the next time you ask, you get the next mission in the chain. That's not consistent with the behavior in #38325 where the same missions get duplicated.