Check emptiness of backlog and str_values to fix tree chopping fetch crash #36705
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 "Check emptiness of backlog and str_values to fix tree chopping fetch crash"
Purpose of change
Fixes #36544
Describe the solution
Check emptiness before trying to access backlog activity or its str values, return empty requirements map if these thigns are empty, activity stops.
Describe alternatives you've considered
N/A
Testing
Stops the crash in the linked issue.
Additional context
I couldnt get the bug to trigger agian by restarting the activity with any of the NPCs there, I cannot think of how the activity str_value had an empty string.
First of all - the NPCs are all outside the range of the usual loot zone search radius, the OP of th eissue said two of the NPCs refused the task and failed correctly.
ONe of them zoomed off to fetch the axe, but didnt store the axe requirement id, which seems impossible from the code - it only applies the fetch activity once its added a string to its string values.
WHenever I tried to get them to do it agian, they alll refused as there wasnt a nearby axe.
But this at least stops it crashing if such a thing occurs again.