Only enumerate the contents of containers in advanced inventory #46203
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.
Not magazines or magazine wells or anything else, just what you think of as ordinary pockets
Summary
SUMMARY: None
Purpose of change
Fixes #45829
Insightful comment about the actual problem in that issue, "Not trying to unload my worn gas mask in the first place.".
The problem here is that advanced inventory is introspecting into all pockets, not just standard ones, leading to situations as reported in the issue where it attempts to move contents of worn items that are not supported, in this case gas mask filters.
Describe the solution
Update the two locations in advanced inventory that enumerate the entire top level of the worn inventory and exclude non-CONTAINER pockets.
Describe alternatives you've considered
There might be a way to just exclude the kind of item that would fail instead of all non-standard pockets, but I don't see a reason to have advanced inventory operate on contents of worn magazines or other specialized containers, they frequently have different rules about how they are manipulated.
Testing
Loaded the attached save from #45829, the importent part of which is that the player is wearing a gas mask, AR-15, and headlamp.
Verify that /, does not cause a debugmsg (can also be verified pre-PR by simply attempting to move the gas mask cartridge).
Verify that the AR-15 ammunition, headlamp battery, and Gas mask filter are not listed in the AIM "Inventory" view.