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 items inside items carried by player getting processed too many times"
Purpose of change
Fixes # 40868
When combined with # 40869 fixes # 40193
Describe the solution
Processing of items carried by player began by processing all items the player had, including items inside items.
Additionally when each item was processed the items inside it were also processed.
This resulted in items inside items being processed multiple times.
Solution is to process all top level items the player has. Items inside these items are processed when the container is processed.
There was also an extra processing done on all worn items. This is removed in "I do not think this does anything" commit. I do not think it did anything and one guess was that it was old code from when things like headlamps were processed separately. If anyone has certain knowledge on what it does please say what it did.
Describe alternatives you've considered
Testing
Items inside items carrioed by player are processed only once.
Tested with water in thermos in pocket with some debugging messages.
Additional context