Skip to content

Commit

Permalink
Creating an in progress craft finds items in nested containers (#42778)
Browse files Browse the repository at this point in the history
* - add recursive method to get all standard item contents of a container
- use it when creating a crafting item

* fix copy&paste errors

* revert and use all_items_ptr

Co-authored-by: mqrause <martin@qrause.de>
  • Loading branch information
mqrause and mqrause authored Aug 9, 2020
1 parent 931c077 commit 92c0ee0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8369,7 +8369,7 @@ bool item::use_amount( const itype_id &it, int &quantity, std::list<item> &used,
// Remember quantity so that we can unseal self
int old_quantity = quantity;
std::vector<item *> removed_items;
for( item *contained : contents.all_items_top() ) {
for( item *contained : contents.all_items_ptr( item_pocket::pocket_type::CONTAINER ) ) {
if( contained->use_amount_internal( it, quantity, used, filter ) ) {
removed_items.push_back( contained );
}
Expand Down

0 comments on commit 92c0ee0

Please sign in to comment.