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: Infrastructure "Create item_location::item_in_container"
Purpose of change
item_location is a class we use that has an item pointer and a reference to where that item lives. additionally, the inventory UI code uses item locations in order for the player to interact with items properly. The invntory code hasn't before needed to interact with items directly inside of containers except in special cases scattered around the code, so this implements that. It also implements item_location::parent_item() which returns the parent of the item_location (nowhere and a debugmsg if it has no parent) to aid with some things that need to know what item the item is inside of. I have written some tests for the item_location because the PR does not make use of the new item_location just yet. Additionally, there is some code that is temporary due to pockets needing to be implemented at the same time as it, marked as a comment.
Testing
see item_location_test.cpp
Additional context
NOTE: contains the commits in both #37816 and #38026