From 92c0ee03b695f9d1f227235ddd96e54e40703a4f Mon Sep 17 00:00:00 2001 From: mqrause <38702195+mqrause@users.noreply.github.com> Date: Sun, 9 Aug 2020 07:28:41 +0200 Subject: [PATCH] Creating an in progress craft finds items in nested containers (#42778) * - 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 --- src/item.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/item.cpp b/src/item.cpp index a8e235c1f21ae..f257737144099 100644 --- a/src/item.cpp +++ b/src/item.cpp @@ -8369,7 +8369,7 @@ bool item::use_amount( const itype_id &it, int &quantity, std::list &used, // Remember quantity so that we can unseal self int old_quantity = quantity; std::vector 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 ); }