Fixed Crash when butchering single animal. #33976
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 "Fixed Butchering related crash #32695"
Purpose of change
To fix the issue related to #32695. I also added checking in other locations where there may be an empty backlog.
Describe the solution
As I understand backlogs. They have a high chance of being empty at this point in time. If the backlog is empty comparing it with another action will result in a segmentation fault. My fix simply checks to see if the backlog is not empty. Then the check can be done safely.
Describe alternatives you've considered
I poked around the code and asked questions on the Discord. I spent a bit of time trying to figure out if the backlog being empty is common in these cases. This is my first time in the code so my confidence is low.
I tested using the attached save file before and after.
Boyne Falls.zip