Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating an in progress craft finds items in nested containers #42778

Merged
merged 3 commits into from
Aug 9, 2020

Conversation

mqrause
Copy link
Contributor

@mqrause mqrause commented Aug 7, 2020

Summary

SUMMARY: Bugfixes "Consume components in nested containers when crafting"

Purpose of change

Fixes #42777

Describe the solution

Created a recursive version of item_contents::all_items_top() and used it when consuming items from a container.

Describe alternatives you've considered

Testing

See issue.

Additional context

item_contents::all_items_top() and item_contents::all_standard_items_top do the same thing, but the former achieves it by iterating over a static vector while the latter does it by checking item_pocket::is_standard_type, which returns true on exactly the elements that are in the static vector. If that's just a coincidence and might change, the names of the methods I created should be changed to something different. all_standard_items_top currently isn't used anywhere, though.

@anothersimulacrum anothersimulacrum added <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Items: Containers Things that hold other things labels Aug 7, 2020
src/item.cpp Outdated Show resolved Hide resolved
@KorGgenT KorGgenT merged commit 92c0ee0 into CleverRaven:master Aug 9, 2020
@mqrause mqrause deleted the nested_crafting branch August 24, 2020 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Items: Containers Things that hold other things
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crafting with components in a nested container
3 participants