Fix starting a fire with a firewood source #31256
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 "Fix starting a fire with a firewood source"
Purpose of change
Fixes #31056 -
Lighting Brazier won't pull from marked firewood source
Describe the solution
This was broken with #31002 which attempted to fix the problem with the previous logic where the charges were consumed prior to the activity finishing. The activity is complicated in that it runs through code to actually move fuel into the fire, and then check whether there is fuel there to continue. I delayed charge usage until the activity finished instead (which is done by several other activities) and added a comment. I also delayed the practice call and stored the possible number in the index field.
Describe alternatives you've considered
My first thought was to decouple the moving items with the notion of checking if there is fuel, but these methods are fairly complex and I did not want to duplicate that code and just delaying the taking of the charge until after the activity seemed better.
Additional context
There are some edge cases that are not accounted for, I suppose .. charges that should be taken even if interrupted.